% % Simple code to iterate Henon Map % clear clf a=input(' Give value for a: '); b=input(' Give value for b: '); nmax=input(' Give number of iterations: '); x(1)=input(' Give starting x: '); y(1)=input(' Give starting y: '); plot(x,y,'k.','markersize',2) for i=1:nmax x(i+1)=y(i)+1-a*x(i)*x(i); y(i+1)=b*x(i); end plot(x,y,'r.','markersize',2) hold on ll=length(x); plot(x(ll-10:ll),y(ll-10:ll),'bo') title(' Circles show last 10 iterations'); hold off