How to locate number from a matrix
1 次查看(过去 30 天)
显示 更早的评论
I have matrix list2, it's a 526x2 double. Suppose the first column represents the ID of people, and the second column represents the total amount of films they shot. I want to find out the N most prolific films shot by the people. I used sort(list2(:,2),'descend') to rearrange the second colomn to get the most movie shot to the least. However, I also need to determine the people's ID, so the question is how to relocate back to the person's ID if we have the information of the second column?
0 个评论
采纳的回答
KSSV
2021-11-30
If idx is the indices of the locations in second column...to get the respective first column just use:
iwant = list2(idx,1)
5 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Denoising and Compression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!