Doing wrong? First, it looks like you have format set to rat.
[V,D] = eig(K);
V
V =
0.179605302026751 -5.06266247219048e-14 0.300510985421823 -0.868600674748355 1.49364371455249e-15
0 0 0 0 0.757946284651594
-0.179605302026794 0.324442842261484 0.544556381601175 0.161114353924498 0.166961764835024
0.898026510133868 -0.811107105653849 -0.444386053127199 -0.45064791217395 -0.0384312697617635
-0.359210604053568 0.486664263392254 0.644726710075106 -0.128419204324953 0.629415789578334
diag(D)
ans =
2.00000000000014
2.99999999999972
5.00000000000016
5
3
So eigenvalues of 2,3,5, the latter are of essentially multiplicity 2 each, if we ignore the trash in those least significant bits.
How about the eigenvectors?
You need to recognize that an eigenvector is unique only to within a scale factor. An eigenvector (V) basically has the property
for corresponding eigenvalue lambda.
But if that holds, then surely
for any scalar value s. So what happens if you scale those eigenvectors?
V(:,1)/V(1,1)
ans =
1
0
-1.00000000000024
5.00000000000064
-2.00000000000037
How interesting.
So eig is NOT returning the wrong eigenvectors. It merely normalizes the eigenvectors so they have unit norm. Your expectations were wrong.
But that is just scaling the vectors by a constant. And we just discussed that that constant is completely arbitrary. At the same time, having unit normalized eigenvectors is very useful in mathematics.
Best Answer