%% Logistic Equation
clear all;
r=3.6;
n=1000;

x(1)=rand;
y(1)=rand;
z(1)=rand;

for i=1:n-1,
    x(i+1)=r*x(i)*(1-x(i));
    y(i+1)=r*y(i)*(1-y(i));
    z(i+1)=r*z(i)*(1-z(i));
end

figure('units','normalized','outerposition',[0 0 1 1]);
hold on;

plot(x,'ro');
plot(y,'b*');
plot(z,'k+');

axis([0,n,0,1]);

figure('units','normalized','outerposition',[0 0 1 1]);
hold on;

plot(abs(x-y),'ro');
plot(abs(x-z),'b*');
plot(abs(y-z),'k+');

axis([0,n,0,1]);
