Documentation

This is machine translation

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

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

nanmax

Maximum ignoring NaNs

Syntax

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

Arguments

X

Financial times series object.

Y

Financial times series object or scalar.

DIM

Dimension of X.

Description

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

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.

Examples

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

Related Examples

See Also

| | | | |

Introduced before R2006a

Was this topic helpful?