How to find the index of maximum value in matrix
6 次查看(过去 30 天)
显示 更早的评论
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!