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.

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.  please help me to convert this matlab script into for loop!
thank you so much. and also merge the two in to one

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!