[kepler-users] Sort Multidimensional Array

Ali, Muhannad muhannad.ali at student.kit.edu
Sun Jan 29 15:35:38 PST 2012


Hello,

is there any way to sort a multi-dimensional array according to some column, e.g. sort(A, j). Or if I have two one-dimensional arrays A1, A2 and after sorting A1, I need that A2's elements that correspond to A1's ones have the updated indices like A1.

Example:

A1 = {2, 0, 3, 1}
A2 = {"x2", "x0", "x3", "x1"}

After sorting A1 (say descending), I need that A2 looks like that: A2={"x3", "x2", "x1", "x0"}


Thanks!

Best regards, 

Muhannad


More information about the Kepler-users mailing list