Minimum ignoring NaNs


m = nanmin(X)
[m,ndx] = nanmin(X)
m = nanmin(X,Y)
[m,ndx] = nanmin(X,[],DIM)



Financial times series object.


Financial times series object or scalar.


Dimension along which the operation is conducted.


nanmin for financial times series objects is based on the Statistics Toolbox™ function nanmin. See nanmin in the Statistics Toolbox documentation.

m = nanmin(X) returns the minimum of a financial time series object X with NaNs treated as missing. m is the smallest non-NaN element in X.

[m,ndx] = nanmin(X) returns the indices of the minimum values in X. If the values along the first nonsingleton dimension contain multiple elements, the index of the first one is returned.

m = nanmin(X,Y) returns an array the same size as X and Y with the smallest elements taken from X or Y. Only Y can be a scalar double.

[m,ndx] = nanmin(X, [], DIM) operates along the dimension DIM.


To compute nanmin for the following dates:

dates = {'01-Jan-2007';'02-Jan-2007';'03-Jan-2007'};
f = fints(dates, magic(3));
f.series1(1) = nan;
f.series2(3) = nan;
f.series3(2) = nan;

[nmin, minidx] = nanmin(f)
nmin =
     3     1     2
minidx =
     2     1     3

See Also

| | |

Was this topic helpful?