1
votes

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

2

2 Answers

4
votes
max(Temp(:))

.. will unravel Temp into a vector, then give you the single largest value.

Of course,

max(max(Temp))

works too.

1
votes

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.