Function min
Compute the maximum value of a matrix or a list of values.
In case of a multi dimensional array, the maximum of the flattened array
will be calculated. When dim
is provided, the maximum over the selected
dimension will be calculated. Parameter dim
is zero-based.
Syntax
min(a, b, c, ...)
min(A)
min(A, dim)
Parameters
Parameter |
Type |
Description |
args |
... * |
A single matrix or or multiple scalar values |
Returns
Type |
Description |
* |
The minimum value |
Examples
min(2, 1, 4, 3); // returns 1
min([2, 1, 4, 3]); // returns 1
// maximum over a specified dimension (zero-based)
min([[2, 5], [4, 3], [1, 7]], 0); // returns [1, 3]
min([[2, 5], [4, 3], [1, 7]], 1); // returns [2, 3, 1]
max(2.7, 7.1, -4.5, 2.0, 4.1); // returns 7.1
min(2.7, 7.1, -4.5, 2.0, 4.1); // returns -4.5
See also
mean,
median,
max,
prod,
std,
sum,
var