% Antti Hannukainen 2.3.2006 
%
% visualize logistic map : how is chaos born ?
%
% 

x0 = 1/2;

logmap = @(r,x)(r*x*(1-x));

figure;
r = [0:0.1:4];

N = 1;
M = 200;

for k=1:1:length(r)
  
  r(k)
  x = x0;

  for i = 1:1:500
    x = logmap(r(k),x);
  end
  
  z = x;
  for i = 2:1:M
    z = [z logmap(r(k),z(i-1))];
  end
  hold on;
  plot( ones(1,length(z))*r(k),z,'b*');
  
end


