using matlab make a table with at most 10 rows of the approx

using matlab make a table with at most 10 rows of the approximations and the rates of convergence (alphas=log[e(n+1)/en]/log[en/e(n-1)]).

Solution

Matlab code to compare is


x0 = 0.5;
z0 = 0.5;
f = @(x) 3*x*x-8*x+1;         
fprime = @(x) 6*x-8;        
tolerance = 10^(-7)    ;  
epsilon = 10^(-14)    ;   
maxIterations = 10   ;    

for i = 1 : maxIterations

    y = f(x0);
    yprime = fprime(x0);

    if(abs(yprime) < epsilon)                      
        % denominator is too small
        break;                                     
    end
x0
z0
    x1 = x0 - y/yprime   ;
    y1=z0-2*y/yprime;
  

    x0 = x1                                                         
    z0=y1
end

using matlab make a table with at most 10 rows of the approximations and the rates of convergence (alphas=log[e(n+1)/en]/log[en/e(n-1)]).SolutionMatlab code to

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site