Input array, specified as a scalar, vector, matrix, or multidimensional
array.

If `A`

is complex, then `min(A)`

returns
the complex number with the smallest magnitude. If magnitudes are
equal, then `min(A)`

returns the value with the smallest
magnitude and the smallest phase angle.

If `A`

is a scalar, then `min(A)`

returns `A`

.

If `A`

is a 0-by-0 empty array, then `min(A)`

is
as well.

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

| `logical`

| `categorical`

| `datetime`

| `duration`

**Complex Number Support: **Yes

Dimension
to operate along, specified as a positive integer scalar. If no value
is specified, then the default is the first array dimension whose
size does not equal 1.

Dimension `dim`

indicates the dimension whose
length reduces to `1`

. The `size(M,dim)`

is `1`

,
while the sizes of all other dimensions remain the same, unless `size(A,dim)`

is `0`

.
If `size(A,dim)`

is `0`

, then `min`

returns
an empty array with the same dimension sizes.

Consider a two-dimensional input array, `A`

:

If `dim = 1`

, then `min(A,[],1)`

returns
a row vector containing the smallest element in each column.

If `dim = 2`

, then `min(A,[],2)`

returns
a column vector containing the smallest element in each row.

`min`

returns `A`

if `dim`

is
greater than `ndims(A)`

.

Additional input array, specified as a scalar, vector, matrix,
or multidimensional array.

The dimensions of `A`

and `B`

must
match, or one can be a scalar.

`A`

and `B`

can
be the same data type or one can be `double`

with
the other `single`

, `duration`

,
or any integer data type.

If `A`

and `B`

are
ordinal categorical arrays, they must have the same sets of categories
with the same order.

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

| `logical`

| `categorical`

| `datetime`

| `duration`

**Complex Number Support: **Yes

`NaN`

condition, specified as one of these
values:

The `min`

function does not support the `nanflag`

option
for `datetime`

, `duration`

, or `categorical`

arrays.

**Data Types: **`char`