Reputation: 61
I have a 111 x 48 Matrix called "TEMP" How do i find the max value in "TEMP"?
max(Temp);
compares all the values in first column and returns the entire row of 48 values. I only need 1 value (highest value) in the entire Matrix.
Thanks in advance
Upvotes: 1
Views: 432
Reputation: 1921
max(max(TEMP))
is what you are looking for. max(X)
returns max value from vector X. If X is matrix, then returns vector of max values in each row. so max(max(TEMP))
will return max value from matrix. Expressions sum(sum(X))
, min(min(X))
works the same.
Upvotes: 1
Reputation: 728
max(Temp(:))
.. will unravel Temp into a vector, then give you the single largest value.
Of course,
max(max(Temp))
works too.
Upvotes: 4