MathGroup Archive 2005

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

Search the Archive

Re: Sorting on multiple columns within a matrix


How about this?

ColumnOrderSort[matrix_List, columns_List] :=
  Sort[matrix, OrderedQ[{#1[[columns]], #2[[columns]]}] &]

ColumnOrderSort[M, {2,1}]//MatrixForm

--Mark


  • Prev by Date: Exporting mathematica equations into MathType
  • Next by Date: moving dingbats
  • Previous by thread: Re: Sorting on multiple columns within a matrix
  • Next by thread: Re: Sorting on multiple columns within a matrix