MATLAB: What does eig function actually do

eigen decomposition

I came across a statement saying that for a complex hermitian matrix,EVD is identical to SVD,where the associated right and left singular vectors are identical. I tried to verify this statement using matlab ,I used the following commands
[U1 S1]=eig(A);
[U2 S2 V2]=svd(A);
where A is hermitian matrix. i got the result as matrices S1 and S2 are identical and also U2=V2,but U1 and U2 are different,why it so?
I mean eigen decomposition says U1*S1*U1'=A SVD decomposition says U2*S2*V2'=A since U2=V2 (same as EVD decomposition) and also S1=S2,then why am i getting U1 and U2 different ??
Thanks

Best Answer

Normalized eigenvectors are invariant to sign changes, so U1 and U2 could have columns differing by a sign.
Furthermore, if A has eigenvalues with multiplicity greater than 1, then there is further flexibility in the choice of eigenvectors for those eigenvalues. The space of eigenvectors then becomes multi-dimensional. You cannot be sure eig and svd will reach the same selection.
Related Question