Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Robert McVay

% %% Question 1

A=[14 12 38 12 -19 7; 24 26 76 24 -38 14; 14 14 48 14 -23 9; -31 -36 -104 -34 52 -21; 4

disp('Question 1 Matrix.')

Question 1 Matrix.

disp(A)

14 12 38 12 -19 7
24 26 76 24 -38 14
14 14 48 14 -23 9
-31 -36 -104 -34 52 -21
45 40 140 40 -68 25
31 26 94 26 -47 18

disp('')
eig(A);

disp('Eigenvalues for Matrix A.')

Eigenvalues for Matrix A.

disp(eig(A))

4.0000 + 0.0000i
-3.0000 + 0.0000i
-3.0000 + 0.0000i
2.0000 + 0.0000i
2.0000 + 0.0000i
2.0000 - 0.0000i

disp('Eigenvalues is 4 with a multiplicity of 1, -3 with a multiplicity of 2, and 2 wit

Eigenvalues is 4 with a multiplicity of 1, -3 with a multiplicity of 2, and 2 with a multiplicity of 3.

disp('')

I=eye(6);

disp('Row Reduced Form for the eigenvalues for 2.')

Row Reduced Form for the eigenvalues for 2.

1
disp(rref(2*I-A))

1.0000 0 0 0 0 -1.0000
0 1.0000 0 1.0000 0 0
0 0 1.0000 0 -0.5000 0.5000
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

[0 1 0 0 1 1]

ans = 1×6
0 1 0 0 1 1

[1 0 0 1 0 5/3]

ans = 1×6
1.0000 0 0 1.0000 0 1.6667

[1 0 0 1 0 5/3]

ans = 1×6
1.0000 0 0 1.0000 0 1.6667

disp('Row Reduced Form for the eigenvalue -3.')

Row Reduced Form for the eigenvalue -3.

disp(rref(-3*I-A))

1 0 0 0 -1 1
0 1 0 0 -2 2
0 0 1 0 -1 1
0 0 0 1 5 -6
0 0 0 0 0 0
0 0 0 0 0 0

[1/2 -1/2 0 1 -1 2/3]

ans = 1×6
0.5000 -0.5000 0 1.0000 -1.0000 0.6667

[0 0 -1 2 -2 2/3]

ans = 1×6
0 0 -1.0000 2.0000 -2.0000 0.6667

disp('Row Reduced Form for the eigenvalue 4.')

Row Reduced Form for the eigenvalue 4.

2
disp(rref(4*I-A))

1.0000 0 0 0 0 -0.3333
0 1.0000 0 0 0 -0.6667
0 0 1.0000 0 0 -0.6667
0 0 0 1.0000 0 1.0000
0 0 0 0 1.0000 -1.6667
0 0 0 0 0 0

[0 1 0 1 -1 1/3]

ans = 1×6
0 1.0000 0 1.0000 -1.0000 0.3333

disp('')

disp('P for Question 1')

P for Question 1

P=[0 1 0 1 -1 1/3; 0 0 -1 2 -2 2/3; 1/2 -1/2 0 1 -1 2/3; 0 0 1 -5 6 -1; 1 0 0 1 0 5/3;


disp(P)

0 1.0000 0 1.0000 -1.0000 0.3333


0 0 -1.0000 2.0000 -2.0000 0.6667
0.5000 -0.5000 0 1.0000 -1.0000 0.6667
0 0 1.0000 -5.0000 6.0000 -1.0000
1.0000 0 0 1.0000 0 1.6667
0 1.0000 0 0 1.0000 1.0000

D=(inv(P))*A*P;

disp('Diagonlizable matrix for A')

Diagonlizable matrix for A

disp(D)

2.0000 0.0000 0 -0.0000 0.0000 -0.0000


-0.0000 2.0000 0 -0.0000 0.0000 -0.0000
-0.0000 0.0000 2.0000 0.0000 -0.0000 -0.0000
-0.0000 -0.0000 -0.0000 -3.0000 -0.0000 -0.0000
0.0000 -0.0000 0.0000 -0.0000 -3.0000 0.0000
0.0000 -0.0000 0 0.0000 -0.0000 4.0000

%% Question 2
A=[-58 69 73 6 28; -99 115 116 10 56; 45 -50 -47 -4 -28;-18 20 20 6 14; 9 -10 -10 -5 -1

disp('Question 2 Matrix.')

3
Question 2 Matrix.

disp(' ');

disp(A)

-58 69 73 6 28
-99 115 116 10 56
45 -50 -47 -4 -28
-18 20 20 6 14
9 -10 -10 -5 -11

eig(A);
disp('The eigenvalues is 3 with a multiplicity of 1, -4 with a mulitiplicity of 2, and

The eigenvalues is 3 with a multiplicity of 1, -4 with a mulitiplicity of 2, and 5 with a multiplicity of

I=eye(5)

I = 5×5
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1

disp('Row Reduced Form for the eigenvalue 5.')

Row Reduced Form for the eigenvalue 5.

disp(rref(5*I-A))

1 0 0 0 6
0 1 0 0 11
0 0 1 0 -5
0 0 0 1 2
0 0 0 0 0

disp('Row Reduced Form for the eigenvalue -4.')

Row Reduced Form for the eigenvalue -4.

disp(rref(-4*I-A))

1 0 0 -5 -3
0 1 0 -7 -3
0 0 1 3 1

4
0 0 0 0 0
0 0 0 0 0

disp('Row Reduced form for the eigenvalue 3.')

Row Reduced form for the eigenvalue 3.

disp(rref(3*I-A))

1 0 0 0 4
0 1 0 0 8
0 0 1 0 -4
0 0 0 1 2
0 0 0 0 0

disp('The Matrix above is undiagonlizable do to the eigenvalues and eigenspace not bein

The Matrix above is undiagonlizable do to the eigenvalues and eigenspace not being correlated (not matchi

You might also like