A=[0 1; -5 -2]

[U,D] = eig(A)     

a = real(D(1,1));
b = imag(D(1,1));

P=[real(U(:,1)) imag(U(:,1))], c=P\[1;0]

y1 = []; y2 = [];

for t=-1:0.05:10;

y1 = [ y1 (real(U(:,1))*cos(b*t) - imag(U(:,1))*sin(b*t))*exp(a*t) ];

y2 = [ y2 (real(U(:,1))*sin(b*t) + imag(U(:,1))*cos(b*t))*exp(a*t) ];

end

figure(7)
%axis([-3 6 -10 4])
plot(y1(1,:),y1(2,:),'g'); hold on

%figure(2)
%axis([-3 6 -10 4])
plot(y2(1,:),y2(2,:),'r'); hold on


x=c(1)*y1+c(2)*y2;
%figure(3)
%axis([-3 6 -10 4])
plot(x(1,:),x(2,:),'b');

