MathGroup Archive 2010

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

Search the Archive

A little help with sort

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112494] A little help with sort
  • From: "Blackwell, Keith" <Keith.Blackwell at rbccm.com>
  • Date: Fri, 17 Sep 2010 06:42:23 -0400 (EDT)

The problem I am having:

Let's  say I have a 200 x 200 matrix.

I want to sort it in order of the values in column one.

Then I want it to sort all the doubles by the values in column two.

Then I want it to sort all the double doubles by reverse of the values
of column 4 or whatever. 

Is there an easy way to do this. I know I can write something long and
annoying to do it, but I'm getting to the point in my use of mathematica
where I want to write more concise code.

Sort[Matrix, #1[[1]]>#2[[1]]&] seems to totally negate any pre
sorting... I tried to fold it backwards starting from column 4 and it
seems that sort just ignores whatever I do then.

Thanks in advance,

Keith
________________________________________

This E-Mail (including any attachments) may contain privileged or confident=
ial information.  It is intended only for the addressee(s) indicated above.

The sender does not waive any of its rights, privileges or other protection=
s respecting this information. 

Any distribution, copying or other use of this E-Mail or the information it=
 contains, by other than an intended recipient, is not sanctioned and is pr=
ohibited.

If you received this E-Mail in error, please delete it and advise the sende=
r (by return E-Mail or otherwise) immediately.

This E-Mail (including any attachments) has been scanned for viruses.

It is believed to be free of any virus or other defect that might affect an=
y computer system into which it is received and opened.

However, it is the responsibility of the recipient to ensure that it is vir=
us free.

The sender accepts no responsibility for any loss or damage arising in any =
way from its use.

E-Mail received by or sent from RBC Capital Markets is subject to review by=
 Supervisory personnel.

Such communications are retained and may be produced to regulatory authorit=
ies or others with legal rights to the information.

IRS CIRCULAR 230 NOTICE:  TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVI=
SE YOU THAT ANY U.S. FEDERAL TAX ADVICE INCLUDED IN THIS COMMUNICATION IS N=
OT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FE=
DERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY AN=
Y TRANSACTION OR MATTER.


  • Prev by Date: Re: Inconsistent behaviour of Integrate
  • Next by Date: Re: Advice on Compile
  • Previous by thread: Re: Map Correlation[] across sublists of matrices
  • Next by thread: Re: A little help with sort