- #1
brydustin
- 205
- 0
Normally when I work in matlab, the eigenvalues of a matrix are arranged in order from least to greatest when I call the function eig(Matrix).
But for some reason, Matlab has decided to start arranging them in order of magnitude (greatest to least)... so that it would arrange the following arbitrary eigenvalues {-3,4,0,-5,6} as:
{6,-5,4,-3,0} rather than the default (smallest to largest with respect to value NOT magnitude): i.e. {-5, -3, 0, 4,6}
Is there a way to put it back? Also, could it be the data type (for example, can certain matrices like orthogonal or symmetric or complex etc... change the way that eig spits out). I'm dealing with real eigenvalues (obviously there is no "standard ordering" of complex numbers (with imaginary parts).
Finally, ... is there really a "default" listing? I know if I take eig([1 0; 0 -1]) it will give {-1,1} every time, for example.
Thanks to all!
But for some reason, Matlab has decided to start arranging them in order of magnitude (greatest to least)... so that it would arrange the following arbitrary eigenvalues {-3,4,0,-5,6} as:
{6,-5,4,-3,0} rather than the default (smallest to largest with respect to value NOT magnitude): i.e. {-5, -3, 0, 4,6}
Is there a way to put it back? Also, could it be the data type (for example, can certain matrices like orthogonal or symmetric or complex etc... change the way that eig spits out). I'm dealing with real eigenvalues (obviously there is no "standard ordering" of complex numbers (with imaginary parts).
Finally, ... is there really a "default" listing? I know if I take eig([1 0; 0 -1]) it will give {-1,1} every time, for example.
Thanks to all!