Question: please help me to convert this matlab script into for loop! thank you so much. and also merge the two in to one m. file.

Ofunction p = secant(f,x,y) i = 2; x (2) =y; x (i+1) = x(i)-f(x(i))*(x(i-1)-x(i))7 (f (x (i-1))-f(x(i))); abs ( (x (i+1)-x (i))/x(i+l)); %3D err = while e rr > le-4 i = i+l; x (i+1) = x(i)-f(x(i))*(x (i-1)-x(i))/ (f (x(i-1))-f(x(i))); err = abs ( (x (i+1)-x(i)) /x(i+l)); end c = ['No.of disp (c); p = x(i+1); Iteration=',num2str(i) ] ; end x-03; y=1; 2 - fun=@ (x)x-2*exp(-x); answer=secant (fun,x,y) 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
