Sort does not work

19 ビュー (過去 30 日間)
RF01
RF01 2019 年 10 月 8 日
回答済み: RF01 2019 年 10 月 8 日
Am I missing something very obvious or does the built-in sort function not work as it is supposed to?sort.png

採用された回答

Stephan
Stephan 2019 年 10 月 8 日
編集済み: Stephan 2019 年 10 月 8 日
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...

その他の回答 (1 件)

RF01
RF01 2019 年 10 月 8 日
Thanks Stefan, you are right!

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by