
% Showing how an orbit of the logistic map fills the whole interval (dense)
% Ricardo Carretero Mar/03

logistic = inline('[4*x.*(1-x)]','x');

Npts=100;
Nit=50;
x=linspace(0,1,100);

fs=15;
lw=1;

x0=pi/30;		% chaotic orbit

figure(1)
clf
set(gca,'FontSize',[fs]);
plot(x,logistic(x),'-k')
axis([0 1 -0.1 1.1])
hold on
fprintf('Press any key to plot 100 iterations ...\n')
pause

X=[x0];
Y=[logistic(x0)];

xo=x0;

for i=1:Nit
 for i=1:Npts
  xn=logistic(xo);
  xo=xn;
  X=[X xn];
  Y=[Y logistic(xn)];
 end
 plot(X,Y,'r*','LineWidth',lw)
 plot(X,Y*0,'b+','LineWidth',lw)
 fprintf('Press any key to plot another 100 iterations ...\n')
 pause
end


