MATLAB: How to index a sorted array with the actual array

indexsort

How to index a sorted array with the actual array?

Best Answer

a = rand(20,1);
[new,idx] = sort(a);