Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A question about sort

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48214] Re: A question about sort
  • From: Marcus Stollsteimer <marcus314 at yahoo.com>
  • Date: Tue, 18 May 2004 04:16:29 -0400 (EDT)
  • References: <c89q6d$t65$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Daohua Song wrote:

> When i get the eigenvalues and eigenvectors for a matrix. i want
> to sort the eigenvalues and hope eigenvectors change the positions
> correspondingly.  How to do it ?

Hi,

you can use Ordering[], e.g.

v1={1,3,2};
v2={a,c,b};
myorder=Ordering[v1];

v1sorted=v1[[myorder]];
v2sorted=v2[[myorder]]

Out: {a, b, c}

for your specific problem, use
{v1,v2} = Eigensystem[matrix]

Regards,
Marcus

-- 
The truth is rarely pure and never simple. -- Oscar Wilde


  • Prev by Date: Re: A question about sort
  • Next by Date: RE: A question about sort
  • Previous by thread: Re: A question about sort
  • Next by thread: RE: A question about sort