From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Permutation of sparse matrices
Date: Wed, 14 Jan 2009 03:41:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <gkjmse$anf$>
References: <>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1231904462 10991 (14 Jan 2009 03:41:02 GMT)
NNTP-Posting-Date: Wed, 14 Jan 2009 03:41:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:511352

John Montgomery <> wrote in message <>...
> ......
> Is there any faster way to change the given matrix in this way that wouldn't require such huge multiplications?  The matrices that I'm using have tens of thousands of rows and columns.  Thanks for the help in advance.
> .....

  You are apparently permuting the rows and columns of your matrix in the same way, though I can't be sure since your examples are all symmetric.  If so, you can do it this way:

 p = [4 3 2 1];
 B = A(p,p);

Roger Stafford