Am I missing something very obvious or does the built-in sort function not work as it is supposed to?sort.png

 Akzeptierte Antwort

Stephan
Stephan am 8 Okt. 2019
Bearbeitet: Stephan am 8 Okt. 2019

1 Stimme

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...

Weitere Antworten (1)

RF01
RF01 am 8 Okt. 2019

0 Stimmen

Thanks Stefan, you are right!

Kategorien

Produkte

Version

R2019b

Tags

Gefragt:

am 8 Okt. 2019

Beantwortet:

am 8 Okt. 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by