clf
N=48;
M=1;
S=1;
X=zeros(3,N);
A=[.5 0 0 ; .5 .3 .2;0 .7 .8] 
for k=1:M
x=[S*(rand-1/2);S*(rand-1/2);S*(rand-1/2)];
 for j = 1:N
    X(:,j)=A^(j-1)*x;     
 end   
plot3(X(1,:),X(2,:),X(3,:),'g-*')
hold on
plot3(X(1,1),X(2,1),X(3,1),'b*')  
plot3(X(1,N),X(2,N),X(3,N),'r*')
%axis([-10 10 -10 10 -10 10]);
end
[P,D]=eig(A)