min
Returns the minimum value of a matrix.
Syntax
R = min(x)
R = min(x, [], dim)
[R,idx] = min(...)
R = min(x, y)
Inputs
- x
- The matrix to query.
- y
- The second matrix for a pairwise query with x.
- dim
- The dimension on which to search.
Outputs
- R
- The minimum value(s).
- idx
- Index of minimum value(s). Not valid for a pairwise query.
Examples
Vector input with two outputs:
[R,IDX] = min([7,1,5])
R = 1
IDX = 2
Matrix input:
R = min([1,6;2,7])
R = [Matrix] 1 x 2
1 6
Matrix input with dimension:
R = min([1,6;2,5],[],1)
R = [Matrix] 1 x 2
1 5
Two matrix inputs:
R = min([1,6;2,5],[1,2;3,4])
R = [Matrix] 2 x 2
1 2
2 4
Comments
For a vector input, it returns the minimum element. For a matrix input, it returns the minimum element from each vector in the direction of interest. If two outputs are requested, it returns a matrix containing the minimum from each element pair.