min
Minimum value along a dimension, or elementwise minimum of two inputs.
Syntax
Section titled “Syntax”m = min(A)m = min(A, [], dim)C = min(A, B)[m, i] = min(A)Description
Section titled “Description”With one argument, returns the minimum value of A — for vectors, the smallest element; for matrices, a row vector of column mins; for higher-dimensional arrays, the mins along the first non-singleton dimension. The optional second return value is the index of the minimum.
With two arguments, returns the elementwise minimum of A and B (broadcasting compatible shapes).
With three arguments and the second equal to [], returns the mins along dimension dim.
When A is a graph handle, returns the minimum of the graph’s data points. In Excel-compatible mode and when any argument is a cell range, the function reduces the entire range to a scalar.
Examples
Section titled “Examples”min([3 1 4 1 5 9 2 6]) % 1min(magic(3)) % [3 1 2] column minsmin(magic(3), [], 2) % [1;3;2] row minsmin([1 5 3], [4 2 3]) % [1 2 3] elementwiseSee also
Section titled “See also”max— Maximum value along a dimension, or elementwise maximum of two inputs.isequal— Test whether two or more inputs are equal in shape and value.
Also categorized under: Range Functions / Math.