help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

random sort


From: Mike Miller
Subject: random sort
Date: Tue, 2 Dec 2003 21:02:29 -0600 (CST)

I don't know why I can't figure this out!  I'd swear I've done it before.
What's the trick to sorting columns in random order?  I have a matrix with
many columns.  Suppose the matrix is called 'X'.  It seems like I should
be able to use something like this:

[S, I] = sort(rand(size(X)));

Then I can use 'I' to sort the columns of X, right?  But how?  I just know
there's an easy trick.

Thanks in advance for breaking my mental block.

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]