min
Minimum elements of an array
Syntax
Description
returns the minimum elements of an array.M
= min(A
)
If
A
is a vector, thenmin(A)
returns the minimum ofA
.If
A
is a matrix, thenmin(A)
is a row vector containing the minimum value of each column ofA
.If
A
is a multidimensional array, thenmin(A)
operates along the first dimension ofA
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 with first dimension0
, thenmin(A)
returns an empty array with the same size asA
.
___ = min(___,'ComparisonMethod',
optionally specifies how to compare elements for any of the previous syntaxes.
For example, for a vector method
)A = [-1 2 -9]
, the syntax
min(A,[],'ComparisonMethod','abs')
compares the elements
of A
according to their absolute values and returns
-1
.