Commit 2dfb3cae authored by ARCHIT GUPTA's avatar ARCHIT GUPTA

added inlab 1

parents
%function that loads a file and parses variables from it
function y=f(x)
myfile = load("input_inlab_task_A1.txt");
nx=myfile(1);
ny=myfile(2);
y=(nx*cos(x)+ny*sin(x))*sin(x/3)-sin(x);
endfunction
% fsolve directly returns the value of unknown in an equation.
[x,info]=fsolve ("f",pi/6.0);
disp(x);
myfile2 = fopen (" output_inlab_task_01.txt", "w");
% fdisp writes to the output file
fdisp(myfile2, x);
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