function fixed_point()
close all
a = .9;
tol = 10^(-16);
imax = 1000;
i = 1;
x(1) = .01;
deltax = 1;
%for i = 1:imax
while deltax >= tol & i <= imax
y(i) = f1(x(i),a);
x(i+1) = y(i);
deltax = abs(y(i)-x(i))
i = i+1;
end
whos
n = length(y)
xx = linspace(0,1,100);
yy = f1(xx,a);

plot(xx,xx,'g',xx,yy,'b',x(1:n),y(1:n),'ro')

function y = f1(x,a)
y = 4*a*x.*(1-x);