用MATLAB算特征值和特征向量,
用MATLAB算特征值和特征向量,
1 3 3 5
1/3 1 1/5 1/3
1/3 5 1 3
1/5 3 1/3 1
第二个矩阵1 3 5
1/3 1 3
1/5 1/3 1
第三个矩阵1 1/5 3 1/5
5 1 3 1
1/3 1/3 1 1/3
5 1 3 1
其中v为特征向量,d为对应的特征值(按列)
>> A=[1 3 3 5;1/3 1 1/5 1/3;1/3 5 1 3;1/5 3 1/3 1]
A =
1.0000 3.0000 3.0000 5.0000
0.3333 1.0000 0.2000 0.3333
0.3333 5.0000 1.0000 3.0000
0.2000 3.0000 0.3333 1.0000
>> [v,d]=eig(A)
v =
0.8474 0.9040 0.9040 0.4153
0.1322 -0.0468 - 0.1499i -0.0468 + 0.1499i -0.1111
0.4679 -0.0179 + 0.3441i -0.0179 - 0.3441i -0.7869
0.2134 -0.1624 + 0.1145i -0.1624 - 0.1145i 0.4427
d =
4.3836 0 0 0
0 -0.1129 + 1.2779i 0 0
0 0 -0.1129 - 1.2779i 0
0 0 0 -0.1577
>> B=[1 3 5;1/3 1 3;1/5 1/3 1]
B =
1.0000 3.0000 5.0000
0.3333 1.0000 3.0000
0.2000 0.3333 1.0000
>> [v,d]=eig(B)
v =
0.9161 0.9161 0.9161
0.3715 -0.1857 + 0.3217i -0.1857 - 0.3217i
0.1506 -0.0753 - 0.1304i -0.0753 + 0.1304i
d =
3.0385 0 0
0 -0.0193 + 0.3415i 0
0 0 -0.0193 - 0.3415i
>> C=[1 1/5 3 1/5;5 1 3 1;1/3 1/3 1 1/3;5 1 3 1]
C =
1.0000 0.2000 3.0000 0.2000
5.0000 1.0000 3.0000 1.0000
0.3333 0.3333 1.0000 0.3333
5.0000 1.0000 3.0000 1.0000
>> [v,d]=eig(C)
v =
0.2234 -0.2136 + 0.2697i -0.2136 - 0.2697i 0.0000
0.6801 0.6454 0.6454 -0.7071
0.1581 -0.1108 - 0.1908i -0.1108 + 0.1908i -0.0000
0.6801 0.6454 + 0.0000i 0.6454 - 0.0000i 0.7071
d =
4.3398 0 0 0
0 -0.1699 + 1.2024i 0 0
0 0 -0.1699 - 1.2024i 0
0 0 0 0.0000