Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: Sorting Rows of a Matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65118] Re: Sorting Rows of a Matrix
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 15 Mar 2006 06:28:34 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <dv69a6$o6l$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
since you don't provide an example I have to make 
my own and

come to:

Table[Random[], {j, 12}, {i, 2}] // Sort[#, 
#1[[2]] < #2[[2]] &] &

Regards

  Jens

"Gregory Lypny" <gregory.lypny at videotron.ca> 
schrieb im Newsbeitrag 
news:dv69a6$o6l$1 at smc.vnet.net...
| Hello everyone,
|
| How can I sort the rows of a matrix by using one 
or more of the
| columns as sort keys just like in a spreadsheet? 
For example, if
| matrix M is 12 x 2 with numbers in the first 
column and unordered
| month numbers in the second, how would I order 
the rows by month?
|
| Regards,
|
| Greg
| 



  • Prev by Date: Re: Sorting Rows of a Matrix
  • Next by Date: Errors at discontinuities
  • Previous by thread: Re: Sorting Rows of a Matrix
  • Next by thread: Re: Sorting Rows of a Matrix