SORT_ND
Efficiently perform an N-dimensional sort along any dimension of an array.
inds=sort_nd(array,dimension)
array: An array of at least 2 dimensions to sort. dimension: The dimension along which to sort, starting at 1 (1:rows, 2:columns, ...).
inds: An index array with the same dimensions as the input array, containing the (1D) sorted indices. Can be used directly to index the arary (ala SORT).
a=randomu(sd,5,4,3,2) sorted=a[sort_nd(a,2)]
HISTOGRAM
Tue Aug 22 15:51:12 2006, J.D. Smithten, based on discussion on c.l.i-p, 08/2006.