Question: I am required to write the program on the right in a way that is similar to the diagram on the left.as flowchart Program 2

I am required to write the program on the right in a way that is similar to the diagram on the left.as flowchart
Program 2.6. newtonhorner: Newton-Hrner method% using the Newton-Horner method starting from the% initial guess XO. The method stops for each root% after 100 iterations or after the absolute value of% the difference between two consecutive iterates is% smaller than 1.e-04.%[ROOTS, ITER]=NEWTONHORNER (A, XO, TOL, NMAX) allows to% define the tolerance on the stopping criterion and% the maximum number of iterations.if nargin ==2tol =1.e-04; nmax =100;elseif nargin ==3nmax =100;endn=length(a)-1; roots = zeros(n,1); iter = zeros(n,1);for k =1:n% Newton iterationsniter =0; x = x0; diff = tol +1;while niter nmax & diff >= tol[pz,b]= horner (a,x); [dpz,b]= horner(b,x);xnew = x - pz/dpz; diff = abs(xnew-x);niter = niter +1; x = xnew;endif (niter==nmax & diff> tol)fprintf([, Fails to converge within maximum ,,..'number of iterations
']);end% Deflation[pz,a]= horner(a,x); roots(k)= x; iter(k)= niter;end
tion obtained - STOP
I am required to write the program on the right

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 Programming Questions!