fixed point iteration ,help needed
Hi i m trying to write a script file in matlab,which takes as input a function f(x) and an initial estimate of the root x0 and outputs the true root of the function f(x). This is th Fixed Point iteration method in matlab.
After i have written my script,i have to test it with a function g(x)=1+1/x at x0
I have already created a script file but i m not sure where i am going wrong.
My script File is:
function x = fixed(g,x0,tol)
can anyone tell me,wht is wrong with this script file. or anyone provide with with an alternate matlab code for fixed point iteration method.
any sort of help will be appreciated . thnks.