How to get sorted index order for an array?
285 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
For example, if I use the sort function on the array [14 8 91 19], I will get [8 14 19 91]. But instead I want [2 1 4 3] which gives me the indices of elements in the original array.
Is there any inbuilt function or does the sort function accept any additional argument to accomplish this? Otherwise I have to write my own function.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!