I have a Matlab program that generates a list x = 6.1692 8.1863 5.8092 8.2754 6.0891 the program also outputs another list aspl = 680 637 669 599 69
Use the second output of sort:
%# sort aspl, get new order of aspl [sortedAspl, sortOrder] = sort(aspl); %# reorder x the same way as aspl sortedX = x(sortOrder);