Clear Filters
Clear Filters

What is the meaning of [B,J]=sort(A,'descend')?

2 views (last 30 days)
zhenyu zeng
zhenyu zeng on 2 Apr 2019
Edited: Stephen23 on 2 Apr 2019
What is the meaning of [B,J]=sort(A,'descend')
Why can he use [B,J] here?
  1 Comment
Stephen23
Stephen23 on 2 Apr 2019
Edited: Stephen23 on 2 Apr 2019
"What is the meaning of [B,J]=sort(A,'descend')"
B = the sorted data.
J = the sort indices along the dimension sorted along.
'descend' = tells sort to sort the values into descending order.
"Why can he use [B,J] here?"
Because its author read the documentation:

Sign in to comment.

Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!