% Chapter 2 - Nonlinear Discrete Dynamical Systems.
% Program 2f - Iteration of the Henon map.
% Copyright Birkhauser 2004. Stephen Lynch.

% A chaotic attractor for the Henon map (Figure 2.22(b)).
a=1.0;
b=0.4;
N=6000;
x=zeros(1,N);
y=zeros(1,N);
x(1)=0.;
y(1)=0;
for n=1:N
    x(n+1)=1+y(n)-a*(x(n))^2;
    y(n+1)=b*x(n);
end 
plot(x(50:N),y(50:N),'*','MarkerSize',10);
 axis([-1 2 -1 1])
fsize=15;
set(gca,'xtick',[-1:1:1],'FontSize',fsize)
set(gca,'ytick',[-1:1:2],'FontSize',fsize)
xlabel('\itx','FontSize',fsize)
ylabel('\ity','FontSize',fsize)

% End of Program 2f.