`(minv, ind)=min(a)`

`(minv)=min(a, b, c, d, ....)`

Inputs | |

`a` |
Any numeric array. |

`{b, c, d,...}` |
Numeric arrays of the same size as `a` or scalars. |

Outputs | |

`minv` |
The minimum value. |

`ind` |
The subscripts associated with the minimum value in the input array. |

If there are multiple inputs to the function, all the inputs which are not scalars must be of the the same size. In this case, the function returns an array of the same size as the non-scalar inputs, and each element of the output is the minimum of the corresponding elements of the inputs. If any of the inputs is a scalar, for the purposes of comparison, it is replaced by an array of the same size as the other inputs with all its elements set equal to the scalar.

If there is only one input, and the input is a vector,

`minv`

is its smallest
element, with `ind`

being the index of this element.
If there is only one input, and the input is a matrix,

`minv`

is the
row vector of the minimal element of each of the columns, and
the corresponding element in `ind`

is the index of the minimal element
in the column. In the case, `minv`

can also be obtained from the
expression `shuffle(a, ind)`

.
If there is only one input, and the input is a multi-dimensional array, the outputs

`minv`

and `ind`

are of the same size as the input
except that along the first
dimension the size is one, and `minv[1,i,j,k,...]`

is the minimal
element of the vector `a[:,i,j,k,...]`

, with `ind[1,i,j,k,...]`

being
the index of the minimal element in this vector.
In this case, `minv`

can also be obtained from the
expression `shuffle(a, ind)`

.
>>min(2,3,4,2,4)2>>a=rand(4,5)>>(mx,ind)=min(a)>>norm(mx-shuffle(a,ind))0