Hi just want to know if someone can maybe help me i have this matrix t want to get the eigenvector but it give me complex values and im pretty sure it must not be complex values for that matrix

2 次查看(过去 30 天)
t= zeros(10);
t(1,2)=1;
t(1,5:10) = 1;
t(2,3:6) = 1;
t(2,8:10)=1;
t(3,1)=1;
t(3,4)=1;
t(3,7:10)=1;
t(4,6:10) =1;
t(5,3:4)=1;
t(5,7:8)=1;
t(5,10)=1;
t(6,3)=1;
t(6,9:10)=1;
t(7,2)=1;
t(7,6)=1;
t(7,10)=1;
t(8,7)=1;
t(8,9)=1;
t(8,10)=1;
t(9,5)=1;
t(9,10)=1;
t
P = eig(t)
  3 个评论

请先登录,再进行评论。

回答(1 个)

Christine Tobler
Christine Tobler 2019-8-23
A simple way to verify if the returned eigenvalues are correct is to compute both the eigenvalues and the eigenvectors, and to compute the residual:
>> [U, D] = eig(t);
>> norm(t*U - U*D)
ans =
5.3327e-15
This is close to machine precision, a good indication that the eigenproblem was solved correctly.
Here are the computed eigenvalues:
>> diag(D)
ans =
2.8990 + 0.0000i
-0.5340 + 1.7329i
-0.5340 - 1.7329i
-0.0934 + 1.1346i
-0.0934 - 1.1346i
-0.6504 + 0.7179i
-0.6504 - 0.7179i
-0.1716 + 0.3782i
-0.1716 - 0.3782i
0.0000 + 0.0000i
For a non-symmetric matrix, it's possible that MATLAB would return eigenvalues with a small imaginary part (around 1e-15) for a matrix with real eigenvalues (as all numerical methods are subject to some numerical tolerance, and we only use an algorithm that guarantees real eigenvalues in the symmetric case). But the eigenvalues here are clearly not close to symmetric at all.
I'm afraid the matrix t doesn't have real eigenvalues. Maybe your exercise is only interested in the two eigenvectors that are connected to the real eigenvalues, 2.8990 and 0?

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by