clf
N=4; % number of iteration
M=40; %number of rand vectors
S=2; %size of the random vecors
X=zeros(2,N);
%A=[.5 .4; -.104 1.1];
A=[1.25 -.75; -.75 1.25];
for k=1:M
x=[S*(rand-1/2);S*(rand-1/2)];
 for j = 1:N
    X(:,j)=A^(j-1)*x;     
 end   
plot(X(1,:),X(2,:),'g-*')
hold on
plot(X(1,1),X(2,1),'b*')  
plot(X(1,N),X(2,N),'r*','MarkerSize',20 )
%axis([-16 16 -16 16]);
end