% logistic map % nn = 300; % number of iterations % y(1) = .5; % initial conditions % r = 3.73; % parameter value % iterations for jj=1:nn y(jj+1) = r.*y(jj).*(1-y(jj)); % logistic map - no noise % y(jj+1) = r.*y(jj).*(1-y(jj)) +.01.*randn(1); % logistic map - small noise % v(2.*jj-1) = y(jj); % save values for plotting below u(2.*jj-1) = y(jj+1); v(2.*jj) = y(jj+1); u(2.*jj) = y(jj+1); end; % % Plotting x = 0:.01:1; y = r.*x.*(1-x); % curve which describes the map % plot(x,x) % plot diagonal y_n+1 - y_n hold on plot(x,y) % plot nonlinear function ry(1-y) plot(v,u,'r') % plot data points from the iteration hold off