max
Largest elements in array
Syntax
M = max(A)
M = max(A,[],dim)
M = max(A,[],nanflag)
M = max(A,[],dim,nanflag)
[M,I] = max(___)
C = max(A,B)
C = max(A,B,nanflag)
Description
returns the largest elements ofM
= max(A
)A
.
If
A
is a vector, thenmax(A)
returns the largest element ofA
.If
A
is a matrix, thenmax(A)
is a row vector containing the maximum value of each column.If
A
is a multidimensional array, thenmax(A)
operates along the first array dimension whose size does not equal1
, treating the elements as vectors. The size of this dimension becomes1
while the sizes of all other dimensions remain the same. IfA
is an empty array whose first dimension has zero length, thenmax(A)
returns an empty array with the same size asA
.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Introduced before R2006a
Was this topic helpful?