Question
Eigenvalues out of order
- July 29, 2010
- 3 replies
- 22077 views
I have a problem with the eigenvals() function. USALLY the results are sorted from largest to smallest, but occasionally they will be out of order. I have found the following simple matrix that demonstrates this:
[A] = 1.0053 1.0053 1.0053
1.0053 2.0001 2.0001
1.0053 2.0001 3.4365
eigenvals(A) = {5.301 0.337 0.803}
This can be a tremendous problem if, for example, I have a 100x100 matrix and I only need the first 3 eigenvalues and their associated eigenvectors.
See attached mathcad sheet with demo and illustration of what I go through to sort the values and vectors properly. Surely there must be a better way!

