clear all;

phi=inline('sqrt(10-x^3)/2','x');

phip=vectorize(phi);
xp=linspace(1,2,100);
yp=phip(xp);
plot(xp, yp)

tol=1e-9;

x(1)=1.5;
x(2)=phi(x(1));
k=2;
while abs( x(k) - x(k-1) ) > tol
    k=k+1;
    x(k)=phi( x(k-1) );
end

format long g
x.'
