How can I get the linear indices of the 4 maximum values of an array?
4 ビュー (過去 30 日間)
古いコメントを表示
I have an 20x1 array of numbers. I know I can use maxk to find the 4 highest values in the array, but if I want to get the linear index values of those 4 numbers how do I do that?
Example of what I mean:
A = [1 2 3 10 8 9 7 4 5 6];
maxk(A,4); gives [10 9 8 7]
If i want the linear indices of 10, 9, 8, and 7 without hardcoding, how can I do that?
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!