Maximum arrays of a matrix
4 ビュー (過去 30 日間)
古いコメントを表示
Hi i have a matrix woth 543 arrays. I wanna choose 10 maximum arrays between these 543 arrays. Need help!
4 件のコメント
採用された回答
DGM
2021 年 12 月 6 日
If all you need to work on is a numeric vector, then
W = [3 5 4 6 7 8 66 444 33 23 4];
Wmx = maxk(W,5) % R2017b or newer
Note that maxk() is relatively new. You can also do the same thing using sort()
% any version
Wmx = sort(W,'descend');
Wmx = Wmx(1:5)
9 件のコメント
Walter Roberson
2021 年 12 月 6 日
use ind2sub() to convert the second output into a row and column number.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!