finding the N highest values in a vector
10 ビュー (過去 30 日間)
古いコメントを表示
i have a vector matrix with a (1*10,000) dimension. I want to find the 10 highest values from this matrix with their respective indices. I can't use sorting because I will lose the original indices of the numbers after sorting. Can anyone help?
Let me know if you have any questions.
0 件のコメント
回答 (1 件)
Matt J
2016 年 10 月 20 日
編集済み: Matt J
2016 年 10 月 20 日
I can't use sorting because I will lose the original indices of the numbers after sorting.
You needn't lose them because [A,J]=SORT(...) will give you the original indices in J. Nevertheless, a more efficient approach than sorting would be to use this FEX subsmission,
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!