Why would you expect that all numbers are always going to be integers? Probably because in your class, your teacher showed you only simple integer vectors and arrays. But real world problems are rarely simply composed of integers.
In fact, eigenvectors from eig are normalized (as I said in my answer) to have a Euclidean norm of 1. That means unless the eigenvector is a very rare case, it will NEVER be entirely composed of integers as it is returned by eig. Consider this matrix, and its eigenvectors.
A = [-2 0 2
2 -1 5
0 0 1];
[V,D] = eig(A);
V(:,2)
ans = 3×1
0.4472
-0.8944
0
I said the columns of V are eigenvectors. Is that true?
V2 = V(:,2)
V2 = 3×1
0.4472
-0.8944
0
●
A*V2
ans = 3×1
-0.8944
1.7889
0
Since when I multiply by V2, it multiplies V2 by 2, this is an eigenvector. Can we scale V2 arbitrarily, so that it is composed of integers? In this case, we may be able to do that.
V2new = V2/V2(1)
V2new = 3×1
1
-2
0
Is it still true that V2 is an eigenvector? Yes, in the sense that A*V2new=2*V2new is still true. V2new is not normalized to have unit norm though.
A*V2new
ans = 3×1
-2
4
0
And since eig returns UNIT normalized eigenvectors, you will almost always see numbers that are not whole numbers. Only in the rare case like the first eigenvector, where we saw this:
V(:,1)
ans = 3×1
0
1
0
●
will an eigenvector happen to be composed of purely integers.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
0 Comments
Sign in to comment.