% BIFDIAG Biffurcation diagram for logistic map. % Francisco J. Beron-Vera % $Revision: 1.0 $ $Date: 2006/09/05 11:52:25 $ clear f=@(x,r) r*x.*(1-x); x=linspace(0,1,250)'; r=linspace(0,4,500); y=[]; for s=r z=x; for I=1:250 z=f(z,s); end y=[y z]; end plot(r,y,'k.','MarkerS',.1) xlabel('$r$','Interpreter','LaTeX') ylabel('$x = f(x)$','Interpreter','LaTeX') title('$f(x) = r x (1-x)$','Interpreter','LaTeX')