One way to implement Algorithm 1 on p.51:
[Corrected 2011-09-13, thanks to EF. MVW]
1. Start Matlab.
2. Write or obtain from the textbook's web site the M-file "fixpt.m"
containing the function definition text of Program 2.1 on p.49.
3. Create a new M-file "g.m" containing the text
function y=g(x)
y=(6+x)^.5
4. Set the values p0, tol, max1 as required at the Matlab prompt ">>".
5. Type
>> fixpt(@g, p0, tol, max1)
Note the @ sign before g. This tells Matlab to look for a function
named g, which it will find in a file named 'g.m' in the search path,
beginning with the current folder.
You can also type
>> [k,p,err,P] = fixpt(@g, p0, tol, max1)
to get more output.