clear

% exploratory graph
x=0:.01:2;
g=inline('(exp(x)+x.^2)/5');
figure;plot(x,g(x),'r',x,x,'k') % want intersections

% try some iterations
x=0.1;
count=0;
while abs(g(x)-x)>1e-4 && count<10
    x=g(x);
    count=count+1;
end
[count x]

x=1.8;
count=0;
while abs(g(x)-x)>1e-4 && count<10
    x=g(x);
    count=count+1;
end
[count x]