Reputation: 48916
Say we have a matrix with dimensions 10x2
. How can I find that maximum value of the rows for column 1
only in matlab
?
Thanks.
Upvotes: 1
Views: 6522
Reputation: 1197
A = rand(10,2); %10x2 matrix
Amax = max(A,[],1); %max across rows
Amax(1) %max of the 1st col
This is a more generic approach in a sense that it computes max across all rows first that can be useful for accessing multiple max elements.
Upvotes: 0