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일

1 개 추천

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일

0 개 추천

Thanks Stefan, you are right!

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

질문:

2019년 10월 8일

답변:

2019년 10월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by