MathGroup Archive 2005

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

Search the Archive

preserving order of eigenvalues in a matrix diagonalization


I'm trying to diagonalize a matrix in Mathematica, but I need the eigenvalues
to stay in order.  So, for instance, for the initial matrix m,

m = {{2, 0}, {0, 3}}

some function, say "diagonalize[m]", should just return m.

If I use

diagonalize[m_] := Transpose[Eigenvectors[m]].m.Eigenvectors[m]

it returns {{3, 0}, {0, 2}}.    I can certainly write my own routine by
hand, but I thought I'd ask if there's an easy way to ask Mathematica to
preserve the order.

Thanks,
john


  • Prev by Date: Re: Question regarding Mathematica's treatment of whitespace
  • Next by Date: Re: SymbolName question
  • Previous by thread: Re: Exporting notebooks to xml (cnxml)
  • Next by thread: Re: preserving order of eigenvalues in a matrix diagonalization