# Sorting Eigensystems [duplicate]

SO I have this code:

{evalueb1,evectorsb1} = Eigensystem[Coefficientsp1];
evalueb1 = 1/(evalueb1*2\[Pi]);

For[i=1,i<(2TruncationOrder+1),i++,If[Abs[Im[evalueb1[[i]]]]
<10^-14,evalueb1[[i]]=Re[evalueb1[[i]]],evalueb1[[i]]=evalueb1[[i]]]];

\[Rho]plus1 = Sort[Select[evalueb1,Im[#]>0\[Or](Im[#]==0\[And]Re[#]>0)&],Im[#2]>Im[#1]&];
\[Rho]minus1 = Sort[Select[evalueb1,Im[#]<0\[Or](Im[#]==0\[And]Re[#]<0)&],Im[#2]Im[#1]&];


What I did was sort the eigenvalues based on the sign of the complex part. How can I make it so that I can find the correct eigenvector associated with the sorted eigenvalues?

• Why not pair up your eigenvalues and eigenvectors, and then sort those pairs? Commented May 23, 2013 at 18:39
• Possible duplicate: mathematica.stackexchange.com/q/7679/5
– rm -rf
Commented May 23, 2013 at 18:41
• How could I do that? I sort the eigenvalues based on which Imaginary part is smaller. Would that change the eigenvalues as well? Commented May 23, 2013 at 18:42
• I also use Select[] to pick certain eigenvalues. So could I pair them up some how and pick an eigenvector with the eigenvalue? Commented May 23, 2013 at 18:47
• Have you seen the post rm linked to? (It would now seem that this is a dupe of that question.) Commented May 23, 2013 at 18:48