function logiter(a,n)
% Graph the nth iterate of the logistic map with
% parameter a.

x0 = 0:0.01:1;
x = x0;

for i=1:n,
  x = a*x .* ( 1-x );
end

figure;
hold on;
plot(x0,x,'k-');
plot([0 1], [0 1], 'b-');
title(['a=' num2str(a) ', iterate ' num2str(n)]);
axis image;
