Products & Services Solutions Academia Support User Community Company

Learn more about Financial Toolbox   

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 Toolbox function nanmax. See nanmax in the Statistics 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

See Also

max, nanmean, nanmedian, nanmin, nanstd, nanvar

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS