How does the eig function calculate its values?

조회 수: 20 (최근 30일)
Matthew Laughlin
Matthew Laughlin 2017년 11월 5일
답변: Christine Tobler 2017년 11월 6일
In this case: [V,D] = eig(A) D is the right eigenvectors and V is the eigenvalues. I've used the Eigen library (in c++) to calculate the eigenvalues for the same matrix but the results are different.

답변 (2개)

Walter Roberson
Walter Roberson 2017년 11월 5일
The documentation for eig() hints that one of chol() or qr() is used, and hints that qr() is always used if A is not symmetric. The generalized eigenvalue, eig(A,B), is documented as accepting an 'algorithm' option to choose between qr and chol, but the regular eigenvalue is not documented as having that, which I would interpret as indicating that it probably uses qr
  댓글 수: 1
Christine Tobler
Christine Tobler 2017년 11월 6일
The algorithms 'chol' and 'qz' are both specific to the generalized eigenvalue problem. For standard eigenvalue problems, there are no options about which algorithm is used.

댓글을 달려면 로그인하십시오.


Christine Tobler
Christine Tobler 2017년 11월 6일
Could you tell us what your results are? Eigenvectors are not uniquely defined, so it's possible for them to look quite different even when using the same algorithm on a different machine due to roundoff. Are the eigenvalues also different?
To check if eigenvalues and eigenvectors are correct without comparing to other results, you can compute A*V - V*D, which should return a matrix containing only round-off values.

카테고리

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