% data for Exercise Set 6.3

ex = input('Exercise number (1-2, 5-20)? ');

if ex==1
   P = [5 7;2 3], D = [2 0;0 1] 
elseif ex==2
   P = [2 -3;-3 5], D = [1 0;0 1/2] 
elseif ex==5
   A = [2 2 1;1 3 1;1 2 2], P = [1 1 2;1 0 -1;1 -1 0]
   D = [5 0 0;0 1 0;0 0 1], Pinv = [1/4 1/2 1/4;1/4 1/2 -3/4;1/4 -1/2 1/4]
elseif ex==6
   A = [4 0 -2;2 5 4;0 0 5], P = [-2 0 -1;0 1 2;1 0 0]
   D = [5 0 0;0 5 0;0 0 4], Pinv = [0 0 1;2 1 4;-1 0 -2] 
elseif ex==7
   A = [1 0;6 -1] 
elseif ex==8
   A = [5 1;0 5] 
elseif ex==9
   A = [3 -1;1 5] 
elseif ex==10
   A = [2 3;4 1] 
elseif ex==11
   A = [-1 4 -2;-3 4 0;-3 1 3] 
elseif ex==12
   A = [4 2 2;2 4 2;2 2 4] 
elseif ex==13
   A = [2 2 -1;1 3 -1;-1 -2 2] 
elseif ex==14
   A = [4 0 -2;2 5 4;0 0 5]  
elseif ex==15
   A = [7 4 16;2 5 8;-2 -2 -5] 
elseif ex==16
   A = [0 -4 -6;-1 0 -3;1 2 5] 
elseif ex==17
   A = [4 0 0;1 4 0;0 0 5] 
elseif ex==18
   A = [0 0 0;0 0 0;3 0 5] 
elseif ex==19
   A = [5 -3 0 9;0 3 1 -2;0 0 2 0;0 0 0 2] 
elseif ex==20
   A = [4 0 0 0;0 4 0 0;0 0 2 0;1 0 0 2] 
else
   disp('No data for this exercise in Section 6.3.')
end
