MathGroup Archive 2006

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

Search the Archive

Re: Sorting Rows of a Matrix


On Mar 14, 2006, at 6:00 AM, Gregory Lypny wrote:

> 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?

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

Regards,

Ssezi


  • Prev by Date: Re: Sorting Rows of a Matrix
  • Next by Date: Re: Writing regular text?
  • Previous by thread: Sorting Rows of a Matrix
  • Next by thread: Re: Sorting Rows of a Matrix