Question: Note: a=8 Goal: Write a MATLAB script to approximate the cube root Va of a given number a with accuracy roughly within 10-8. Use initial
Note: a=8



Goal: Write a MATLAB script to approximate the cube root Va of a given number a with accuracy roughly within 10-8. Use initial guessand maximum 100 iterations. Please rewrite the code in page 2 and play with it. Here, I have implemented the Fixed-Point iteration method for cos(x)-sin(x)-0 oint iteration method for cOS - sin( loloblihllololelblolelol Fixed parameters viiihhl iter- 0; iter_max - 100; rel_error-10; tolerance10-8 xold-0; % initial guess f -0(x) (x + cos (x)-sin(x)); x_appro -; % solves cos (x) -sin(x) rel error col-; ((rel-error new- f(xold); % think about this line rel_error-abs (xnew-xold); rel error_col- [rel_error_col;rel_error]; x_appro -[x_appro; xnew] xold - xnew; iter-iter 1; while > tolerance) 11 (iter > iter-max)) % ???? tot_iter-(1:iter)'; x apprO; fprintf('Simulation Summary '); fprintf('iteration x-values Relative error ') fprintf("X3 . Of \t %6.8f \t %6.8f ', [tot-iter , ;x-appro'; rel-error-col'])
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
