MATLAB Function Reference
  Go to function:
    Search    Help Desk 
min    See Also

Minimum elements of an array

Syntax

Description

C = min(A) returns the smallest elements along different dimensions of an array.

If A is a vector, min(A) returns the smallest element in A.

If A is a matrix, min(A) treats the columns of A as vectors, returning a row vector containing the minimum element from each column.

If A is a multidimensional array, min operates along the first nonsingleton dimension.

C = min(A,B) returns an array the same size as A and B with the smallest elements taken from A or B.

C = min(A,[],dim) returns the smallest elements along the dimension of A specified by scalar dim. For example, min(A,[],1) produces the minimum values along the first dimension (the rows) of A.

[C,I] = min(...) finds the indices of the minimum values of A, and returns them in output vector I. If there are several identical minimum values, the index of the first one found is returned.

Remarks

For complex input A, min returns the complex number with the smallest modulus, computed with min(abs(A)). The min function ignores NaNs.

See Also

max         Maximum elements of an array

mean        Average or mean values of array

median      Median values of array

sort        Sort elements in ascending order



[ Previous | Help Desk | Next ]