Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: ordering a large matrix and referring to the named rows later

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75411] Re: ordering a large matrix and referring to the named rows later
  • From: SzH <szhorvat-nospamplease at gmail.com>
  • Date: Sat, 28 Apr 2007 06:04:22 -0400 (EDT)
  • Organization: University of Bergen
  • References: <f0n8n0$s99$1@smc.vnet.net>

newbie wrote:
> Hi,
> I have a large matrix {5165, 26}, the first row and first 8 columns
> identify the values in the matrix.  I need to be able to sort the data
> without losing the ability to reference the labels.  Any ideas?
> Thank you very much for any help!
> 
> 

I am not sure I understand you question correctly, but I hope this helps:

You have a list of lists, so you need a comparison function that works 
with lists as arguments. E.g. to use the 9th column as a key for 
sorting, try

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

Szabolcs


  • Prev by Date: Re: Solving a differential equation numerically in Mathematica
  • Next by Date: associate a parameter name with a string
  • Previous by thread: Re: ordering a large matrix and referring to the named rows later
  • Next by thread: Apply filter to measured data