(B) 行列の固有値と固有ベクトルの計算


(a) 行列の固有値と固有ベクトル

>> A = [2 1; 1 2]
A =
     2     1
     1     2
>> eig(A)
ans =
     1
     3
>> A = [2 1; 1 2]
A =
     2     1
     1     2
>> [S, Lambda] = eig(A)
S =
   -0.7071    0.7071
    0.7071    0.7071
Lambda =
     1     0
     0     3
>> lambda1 = Lambda(1,1)
lambda1 =
     1
>> lambda2 = Lambda(2,2)
lambda2 =
     3
>> v1 = S(:,1)
v1 =
   -0.7071
    0.7071
>> v2 = S(:,2)
v2 =
    0.7071
    0.7071

(b) 特性多項式と特性方程式の解

>> A = [2 1; 1 2]
A =
     2     1
     1     2
>> poly(A)
ans =
     1    -4     3
>> roots(poly(A))
ans =
     3
     1

(c) 対角化

>> A = [2 1; 1 2]
A =
     2     1
     1     2
>> [S, Lambda] = eig(A)
S =
   -0.7071    0.7071
    0.7071    0.7071
Lambda =
     1     0
     0     3
>> M = inv(S)*A*S
M =
     1     0
     0     3