This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Maximum ignoring NaNs


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



Financial times series object.


Financial times series object or scalar.


Dimension of X.


nanmax for financial times series objects is based on the Statistics and Machine Learning Toolbox™ function nanmax. See nanmax.

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

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

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

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


To compute nanmax 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;

[nmax, maxidx] = nanmax(f)
nmax =
     4     5     6

maxidx =
     3     2     1

Introduced before R2006a

Was this topic helpful?