develop your own matlab function for the


Develop your own Matlab function for the Fixed-point method. Use the approximate relative error as your stopping criterion. The first line of your function should be function [root,froot,ea,iter] = fixedpoint(func,xr,es,maxit) where func is the function handle for the function to find the root of, xr is the initial guess for the starting point, es is the stopping criterion for the approximate relative error, and maxit is the maximum number of iterations; rootis the value of the root, froot is the function value at root, ea is the approximate error of that root, and iter is the number of iterations needed.

Test your code for f(x) = 0.2-log(x^0.2) = 0, using an initial guess of xr = 1 and a stopping criterion es=1.e-4. (The correct result is x=exp(1)= 2.718281828459046.)

 

 

Solution Preview :

Prepared by a verified Expert
Applications of MATLAB: develop your own matlab function for the
Reference No:- TGS0497841

Now Priced at $15 (50% Discount)

Recommended (99%)

Rated (4.3/5)