eig return complex values
古いコメントを表示
Hello,
I'm trying to find the eigenvalues and eigenvectors of an invertible matrix. The eig function returns me complex values.
But the matrix is invertible: I invert it on Pascal.
How to explain and especially how to solve this problem please?
The matrix I am trying to invert is the inv(C)*A matrix, from the attached files.
Thanks,
Michael
5 件のコメント
Matt J
2022 年 1 月 22 日
Invertible matrices can have complex eigenvalues. That in itself is not a sign of a problem.
Michael cohen
2022 年 1 月 22 日
A diagonalizable matrix can also be invertible with complex eigenvalues. A simple example is C=1i*eye(N).
In any case, I do not see the complex eigenvalues for the matrix you've provided.
load(websave('t','https://www.mathworks.com/matlabcentral/answers/uploaded_files/869735/matrix_C.mat'))
isreal(eig(C))
Michael cohen
2022 年 1 月 22 日
編集済み: Michael cohen
2022 年 1 月 22 日
採用された回答
その他の回答 (1 件)
It turns out that B=C\A does have real eigenvalues in this particular case, but floating point errors approximations produce a small imaginary part that can be ignored.
load matrices
E=eig(C\A);
I=norm(imag(E))/norm(real(E))
So just discard the imaginary values,
E=real(E);
2 件のコメント
Michael cohen
2022 年 1 月 23 日
Matt J
2022 年 1 月 23 日
You 're welcome but please Accept-click one of the answers.
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
