matlab中min max函数的用法
min Smallest component.
For vectors, min(X) is the smallest element in X. For matrices,
min(X) is a row vector containing the minimum element from each
column. For N-D arrays, min(X) operates along the first
non-singleton dimension.
[Y,I] = min(X) returns the indices of the minimum values in vector I.
If the values along the first non-singleton dimension contain more
than one minimal element, the index of the first one is returned.
min(X,Y) returns an array the same size as X and Y with the
smallest elements taken from X or Y. Either one can be a scalar.
[Y,I] = min(X,[],DIM) operates along the dimension DIM.
When X is complex, the minimum is computed using the magnitude
min(ABS(X)). In the case of equal magnitude elements, then the phase
angle min(ANGLE(X)) is used.
min(..., NANFLAG) specifies how NaN (Not-A-Number) values are treated.
NANFLAG can be:
'omitnan' - Ignores all NaN values and returns the minimum of the
non-NaN elements. If all elements are NaN, then the
first one is returned.
'includenan' - Returns NaN if there is any NaN value. The index points
to the first NaN element.
Default is 'omitnan'.
Example: If X = [2 8 4; 7 3 9] then
min(X,[],1) is [2 3 4],
min(X,[],2) is [2; 3] and
min(X,5) is [2 5 4; 5 3 5].