%movie of graphical iteration of logistic function
%input number of iterates, parameter and start
close all
clc
r=input('r=')
p=input('initial point =')
iterates =input('number of iterations =') 
x=linspace(0,1,400);
y=logistic(x,r);
plot(x, x)
hold on
plot(x,y,'r')
q=logistic(p,r);
for j=1:iterates
plot([p p],[p,q],'k')
plot([p q],[q q],'k')
title(j)
xlabel(r)
p=q;
q=logistic(p,r);
pause(3)
end	
zoom
