Services & Resources / Wolfram Forums
MathGroup Archive
*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
  • Subject: [mg65108] Re: [mg65089] Sorting Rows of a Matrix
  • From: Bob Hanlon <hanlonr at>
  • Date: Wed, 15 Mar 2006 06:28:19 -0500 (EST)
  • Reply-to: hanlonr at
  • Sender: owner-wri-mathgroup at

Sort[data, #1[[2]] < #2[[2]] &]

Bob Hanlon

> From: Gregory Lypny <gregory.lypny at>
To: mathgroup at
> Subject: [mg65108] [mg65089] Sorting Rows of a Matrix
> 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: Writing regular text?
  • Next by Date: Re: Graphics3D polygon face colors
  • Previous by thread: Re: Sorting Rows of a Matrix
  • Next by thread: RE: Sorting Rows of a Matrix