On Saturday, 24 January 2015 19:00:14 UTC-5, [email protected] wrote: > > See the sort functionality in Matlab; the fourth usage case [B,I] = sort( > ___) > > http://www.mathworks.com/help/matlab/ref/sort.html#bt83dd_-1 > > Is there a julia version or julia way? >
sortperm seems to do approximately what you want: http://julia.readthedocs.org/en/latest/stdlib/sort/#Base.sortperm But it doesn't return a copy of the array, sorted, so you have to do "i = sortperm(x); y = x[i]". Note that sortperm! doesn't sort the array in-place, but rather uses a pre-allocated vector of indices.
