clear close all lambda1 = -2; lambda2 = 4; Lambda = diag([lambda1;lambda2]); v1 = [1;1]; v2 = [1;-1]; T = [v1,v2]; A = T*Lambda*inv(T); [Z1,Z2] = meshgrid(-10:1:10,-10:1:10); Uz = lambda1*Z1; Vz = lambda2*Z2; subplot(1,2,2) quiver(Z1,Z2,Uz,Vz); xlabel('z_1') ylabel('z_2') axis([-10,10,-10,10]) axis square hold on [X1,X2] = meshgrid(-10:1:10,-10:1:10); Ux = A(1,1)*X1+A(1,2)*X2; Vx = A(2,1)*X1+A(2,2)*X2; subplot(1,2,1) quiver(X1,X2,Ux,Vx); xlabel('x_1') ylabel('x_2') axis([-10,10,-10,10]) axis square hold on t = [0:0.01:1]'; for theta = 0:pi/8:2*pi z0 = 5*[cos(theta);sin(theta)]; z1 = exp(lambda1*t)*z0(1); z2 = exp(lambda2*t)*z0(2); figure(1) subplot(1,2,2) plot(z1(1),z2(1),'ro',z1,z2,'r') hold on x = z1*v1'+z2*v2'; x1 = x(:,1); x2 = x(:,2); subplot(1,2,1) plot(x1(1),x2(1),'ro',x1,x2,'r') hold on figure(2) subplot(2,2,2) plot(t(1),z1(1),'ro',t,z1,'r') ylabel('z_1(t)') xlabel('t (s)') axis([0 1 -20 20]) hold on subplot(2,2,4) plot(t(1),z2(1),'ro',t,z2,'r') ylabel('z_2(t)') xlabel('t (s)') axis([0 1 -20 20]) hold on subplot(2,2,1) plot(t(1),x1(1),'ro',t,x1,'r') ylabel('x_1(t)') xlabel('t (s)') axis([0 1 -20 20]) hold on subplot(2,2,3) plot(t(1),x2(1),'ro',t,x2,'r') ylabel('x_2(t)') xlabel('t (s)') axis([0 1 -20 20]) hold on end