Path: news.mathworks.com!not-for-mail
From: "Robert Sparr" <robertdotsparr@NOSPAMsri.com>
Newsgroups: comp.soft-sys.matlab
Subject: unsorted eigenvalues
Date: Fri, 28 Sep 2007 04:26:46 +0000 (UTC)
Organization: SRI International
Lines: 29
Message-ID: <fdhvq6$hok$1@fred.mathworks.com>
Reply-To: "Robert Sparr" <robertdotsparr@NOSPAMsri.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1190953606 18196 172.30.248.35 (28 Sep 2007 04:26:46 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 28 Sep 2007 04:26:46 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 60637
Xref: news.mathworks.com comp.soft-sys.matlab:430551



I'm doing eigendecomposition-based spectral analysis, and I
am looking for a way to recover the eigenvalues of a matrix
(positive semidefinite Hermitian, in my case) without having
them sorted for me.

I've seen this topic come up in other threads (such as
"Sorted Eigenvalues & Eigenvectors?" of April 2004 and
"non-sorting SVD" of May 2007), but the answers there
haven't settled my problem.

In my experience, eig() always returns the eigenvalues
sorted in ascending order, despite statements to the
contrary in previous threads.  (Perhaps this changed with a
recent version?)

I am aware that the eigenvectors have been sorted so that
eigenvector index i corresponds to eigenvalue index i, and I
know how to reconstruct the signal with the sorted output
given by eig(), but that is not sufficient.  I also need to
know the indexes that the significant eigenvalues had before
they were sorted.  The ideal way to do this would be if
eig() or some other function had an optional argument I
could use to suppress the sorting function in eig().  (After
all, MATLAB has an easy-to-use sort() function, if I want
sorted output.)  Since this seems to be a recurring
question, I suspect other people want this, too.

Thanks for any suggestions,
R