How to find the index of maximum value in matrix
조회 수: 7 (최근 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!