How to find the index of maximum value in matrix
7 ビュー (過去 30 日間)
古いコメントを表示
Jaffrey Hudson Immanuel Jeyakumar
2019 年 8 月 5 日
編集済み: madhan ravi
2019 年 8 月 5 日
Hallo ,
This question has asked again,
I have a 4*2 Matrix 'A' as follows
ID Value
1 10
2 -5
3 6
4 -15
I want to find the index for Maximum of absolute value in column 2 and find its correcponding ID value in column 1,
I used the following line
[i,j]= find(max(abs(A(:,2))));
But it did not give the index
kindly help me.
0 件のコメント
採用された回答
madhan ravi
2019 年 8 月 5 日
編集済み: madhan ravi
2019 年 8 月 5 日
[Value, Position] = max(abs(A(:,2)))
A(Position,1) % corresponding ID
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!