Skip to content

min

Minimum value along a dimension, or elementwise minimum of two inputs.

m = min(A)
m = min(A, [], dim)
C = min(A, B)
[m, i] = min(A)

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.

min([3 1 4 1 5 9 2 6]) % 1
min(magic(3)) % [3 1 2] column mins
min(magic(3), [], 2) % [1;3;2] row mins
min([1 5 3], [4 2 3]) % [1 2 3] elementwise
  • 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.