find max value in a matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a=[ 1 2 3; 7 8 9; 4 5 6; 2 1 3]. I want to find max value in the matrix 'a' but i don't want it to consider second row. So I should get 6 as the answer. How to do it?
0 Kommentare
Antworten (1)
Star Strider
am 22 Feb. 2015
This works:
a=[ 1 2 3; 7 8 9; 4 5 6; 2 1 3];
a_134 = a([1 3 4],:);
max_a134 = max(a_134(:));
2 Kommentare
Star Strider
am 22 Feb. 2015
In that instance, just nest two max calls:
max_a134 = max(max(a([1 3 4],:)))
Siehe auch
Kategorien
Mehr zu Logical 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!