Sort does not work
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Am I missing something very obvious or does the built-in sort function not work as it is supposed to?

0 Kommentare
Akzeptierte Antwort
Stephan
am 8 Okt. 2019
Bearbeitet: Stephan
am 8 Okt. 2019
Why? for me the indices are correct sorted. The smallest value is found at pos. 3 and the biggest value is found in pos. 4. What is the problem?
Note that the documentation says:
[B, I] = sort(X)
you changed it to:
[I, B] = sort(X)
So maybe what you expect to get is stored in variable I - not B...
0 Kommentare
Weitere Antworten (1)
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!