sorting

8 views (last 30 days)
kash
kash on 16 Feb 2012
I have a code
[out ind]=sort(Distance)
in out i get sorted value of distance
what that ind indicates,in that i get values between i to 80 randomly
i have 80 values in Distance please tell

Accepted Answer

Walter Roberson
Walter Roberson on 16 Feb 2012
ind is the indices of the unsorted data. For example if out(3) corresponds to the value of the 3rd smallest distance, and ind(3) corresponds to the index in that that value had in the original unsorted data. Distance(ind(3)) -> out(3)
In other words, ind is the order the the data items had to be arranged in to in order to get the sorted values.
  1 Comment
kash
kash on 16 Feb 2012
THANKS WALTER

Sign in to comment.

More Answers (0)

Categories

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

Tags

Community Treasure Hunt

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

Start Hunting!