MathGroup Archive 1997

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

Search the Archive

Re: Sorting tables by columns


fbd2 at psu.edu wrote:
> 
> Hi,
> 
> Does anyone know how to sort tables by one of its columns?

> Thanks,
> 
> Flavio


Flavio,

This will do it:

sortOnFirstColumn[matrix_]:=Sort[matrix,(First[#1]<=First[#2])&]

-- 
-----------------------------
Dick Zacher                    
Performance Engineering Dept., Tandem Computers
zacher_dick at tandem.com     phone: 408-285-5746     fax:   408-285-7079


  • Prev by Date: Printing in HelpBrower??
  • Next by Date: Attributes
  • Previous by thread: Re: Sorting tables by columns
  • Next by thread: system of non-linear ODEs