Commit 3e1cc5f2 authored by CHANDAN SNEHAL KAILAS's avatar CHANDAN SNEHAL KAILAS

snehal's changes

parent 5d699194
Group Name terror
Number 21
(150050050-Kunal Makwane)(150050106-Arshdeep Singh)(150070023-Snehal Chandan)
Honour Code:
I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Reflection Essay:
*Got to learn about octave and hence learn how to solve equations directly using predefined functions
like fzero and fsolve.
*How to create output file and input values into variables from an input file using methods like
fopen,load, fwrite etc.
*We learnt about %f,%d and other formats and how to set the precision of the answer.
Member contribution:
All the three contributed equally.
Kunal Makwane 100%
Arshdeep Singh 100%
Snehal Chandan 100%
N=load("input_inlab_task_A1.txt"); %input file
nx=N(1); %input first value that is nx
ny=N(2); %input second value that is ny
fun=@(i)nx*cos(i)*sin(i/3)+ny*sin(i)*sin(i/3)-sin(i); %function declaration
z=fzero(fun,0.00001) %using predefined function fzero to find solution of fun=0
a=fopen("output_inlab_task_01.txt","w"); %creating output file (write format)
fprintf(a,"%2.16f",z); %printing in output file
fclose(a); %closing the output file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment