How to extract two equal maximum values at different index
2 ビュー (過去 30 日間)
古いコメントを表示
Hi guys,
How can I point out the different location of two maximum values
example A = [8,5,6,7,8]
If i type [max_A, index] = max(A), it will give me max = 8 and index = 1, but in this case the index must be 1 and 5.
0 件のコメント
採用された回答
その他の回答 (1 件)
KSSV
2019 年 3 月 20 日
A = [8,5,6,7,8]
maxval = max(A);
lia = ismember(A,maxval);
idx = find(lia);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!