<< nan_coef_of_variation Descriptive Statistics nan_detrend >>

NaN Toolbox >> NaN Toolbox > Descriptive Statistics > nan_cumsum

nan_cumsum

Cumulative sum while skiping NaN's.

Calling Sequence

y = nan_cumsum(x,DIM)

Parameters

DIM:

dimension

default or []:

first DIMENSION, with more than 1 element

x:

input data

y:

resulting sum

Description

NaN values are not thown away, but skipped.

Examples

x=[1 2 %nan 5];
cumsum(x)
ans  =

1.    3.    Nan   Nan
cumsum(thrownan(x))
ans  =

1.    3.    8.
nan_cumsum(x)
ans  =

1.    3.    Nan   8.

See also

Authors


<< nan_coef_of_variation Descriptive Statistics nan_detrend >>