How to find the index of maximum value in matrix
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jaffrey Hudson Immanuel Jeyakumar
am 5 Aug. 2019
Bearbeitet: madhan ravi
am 5 Aug. 2019
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 Kommentare
Akzeptierte Antwort
madhan ravi
am 5 Aug. 2019
Bearbeitet: madhan ravi
am 5 Aug. 2019
[Value, Position] = max(abs(A(:,2)))
A(Position,1) % corresponding ID
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!