Re: Sorting on multiple columns within a matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg57859] Re: Sorting on multiple columns within a matrix
- From: "Mark Fisher" <mark at markfisher.net>
- Date: Fri, 10 Jun 2005 02:29:23 -0400 (EDT)
- References: <d892lm$sc6$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
How about this? ColumnOrderSort[matrix_List, columns_List] := Sort[matrix, OrderedQ[{#1[[columns]], #2[[columns]]}] &] ColumnOrderSort[M, {2,1}]//MatrixForm --Mark