Does the eig() function return normalize eigen vector (unit length)?

42 visualizzazioni (ultimi 30 giorni)
The function eig:
[V, D]=eig(A);
The V is normalized(unit length) or not?

Risposta accettata

John D'Errico
John D'Errico il 14 Mar 2023
Modificato: John D'Errico il 14 Mar 2023
Yes. V is normalized to have unit 2-norm, at least in common cases. Surely you could have checked that?
A = magic(5);
[V,D] = eig(A);
norm(V(:,1),2)
ans = 1
Here is the doc page for eig: eig
In there we can find the exceptions:
The form and normalization of V depends on the combination of input arguments:
  • [V,D] = eig(A) returns matrix V, whose columns are the right eigenvectors of A such that A*V = V*D. The eigenvectors in V are normalized so that the 2-norm of each is 1.If A is real symmetric, Hermitian, or skew-Hermitian, then the right eigenvectors V are orthonormal.
  • [V,D] = eig(A,'nobalance') also returns matrix V. However, the 2-norm of each eigenvector is not necessarily 1.
  • [V,D] = eig(A,B) and [V,D] = eig(A,B,algorithm) return V as a matrix whose columns are the generalized right eigenvectors that satisfy A*V = B*V*D. The 2-norm of each eigenvector is not necessarily 1. In this case, D contains the generalized eigenvalues of the pair, (A,B), along the main diagonal.When eig uses the 'chol' algorithm with symmetric (Hermitian) A and symmetric (Hermitian) positive definite B, it normalizes the eigenvectors in V so that the B-norm of each is 1.
Always read the help. It is there to answer you questions, in fact, more quickly than it took me to write this answer, and for you to wait for someone to respond, and then have you read my copy of the relevant help block.
I will admit though, it did force me to read down to the bottom of the doc to find that information. Part of me would have liked to see it higher up, but the different cases are sufficiently dependent on the different modes eig can work in, so I would not change the documentation as it is written.
  3 Commenti
John D'Errico
John D'Errico il 14 Mar 2023
By deleting a question, you remove the opportunity for anyone else to gain from it. And when you delete a question, you also delete (not that I personally care about site rep) any reputation given to the person who spent the time to answer your question.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by