disp('The following are reference solutions and selected comments. ') disp('Students should continue to work the problems in small steps.') clear disp('Note that MATLAB automatically normalizes the eigenvectors by') disp('making them unit vectors -- since the text book problems are') disp('"COOKED UP" to give nice numbers, try to find some eigen vectors') disp('that have integer components'); pause A9=[2 0 0 0;0 -1 0 5;0 4 6 4;0 5 0 -1] p=poly(A9) clf ss=roots(p); xx=[-10:.1:10]; yy=polyval(p,xx); plot([-10,10],[0,0],'g-',[0,0],[-100,100],'c-'); hold on plot(xx,yy,'m',ss,zeros(size(ss)),'yo'); axis([-10,10,-100,100]) [EVectors,EVals]=eig(A9) pause A22=[4 1 0;1 4 0;0 -3 0] p=poly(A22) clf ss=roots(p); xx=[-10:.1:10]; yy=polyval(p,xx); plot([-10,10],[0,0],'g-',[0,0],[-100,100],'c-'); hold on plot(xx,yy,'m',ss,zeros(size(ss)),'yo'); axis([-10,10,-10,10]) [EVectors,EVals]=eig(A22) pause disp('The following matrix has a repeated eigenvalue, which has two') disp('"LINEARLY INDEPENDENT" associated eigenvalues -- there are many choices!') pause A26=[0 0 2 0;1 0 1 0;0 1 -2 0;0 0 0 1] p=poly(A26) clf ss=roots(p); xx=[-10:.1:10]; yy=polyval(p,xx); plot([-10,10],[0,0],'g-',[0,0],[-100,100],'c-'); hold on plot(xx,yy,'m',ss,zeros(size(ss)),'yo'); axis([-10,10,-10,10]) [EVectors,EVals]=eig(A26) pause disp('The following three problems adress matrices that have ones on') disp('the sinistral diagonal bottom left to top rite. Again, there are') disp('repeated eigenvalues, leading to several eigenvectors for some evalues.') pause A51=flipud(eye(2)) p=poly(A51) clf ss=roots(p); xx=[-10:.1:10]; yy=polyval(p,xx); plot([-10,10],[0,0],'g-',[0,0],[-100,100],'c-'); hold on plot(xx,yy,'m',ss,zeros(size(ss)),'yo'); axis([-10,10,-10,10]) [EVectors,EVals]=eig(A51) pause A52=flipud(eye(3)) p=poly(A52) clf ss=roots(p); xx=[-10:.1:10]; yy=polyval(p,xx); plot([-10,10],[0,0],'g-',[0,0],[-100,100],'c-'); hold on plot(xx,yy,'m',ss,zeros(size(ss)),'yo'); axis([-10,10,-10,10]) [EVectors,EVals]=eig(A52) pause A53=flipud(eye(4)) p=poly(A53) clf ss=roots(p); xx=[-10:.1:10]; yy=polyval(p,xx); plot([-10,10],[0,0],'g-',[0,0],[-100,100],'c-'); hold on plot(xx,yy,'m',ss,zeros(size(ss)),'yo'); axis([-10,10,-10,10]) [EVectors,EVals]=eig(A53) pause A58=[1 0 0 0 0 -3;2 2 0 0 0 -1;3 0 1 0 0 4;... 4 0 0 -1 0 3;-1 0 0 0 1 2;-3 0 0 0 0 1] p=poly(A58) clf ss=roots(p); xx=[-10:.1:10]; yy=polyval(p,xx); plot([-10,10],[0,0],'g-',[0,0],[-100,100],'c-'); hold on plot(xx,yy,'m',ss,zeros(size(ss)),'yo'); axis([-10,10,-10,10]) [EVectors,EVals]=eig(A58) pause hw62