adds all non-NaN values.
Y = sumskipnan(x [,DIM]) [Y,N,SSQ] = sumskipnan(x [,DIM]) [...] = sumskipnan(x, DIM, W)
input data
dimension (default: []) empty DIM sets DIM to first non singleton dimension
weight vector for weighted sum, numel(W) must fit size(x,DIM)
resulting sum
number of valid (not missing) elements
sum of squares
All NaN's are skipped; NaN's are considered as missing values. sumskipnan of NaN's only gives O; and the number of valid elements is return. sumskipnan is also the elementary function for calculating various statistics (e.g. MEAN, STD, VAR, RMS, MEANSQ, SKEWNESS, KURTOSIS, MOMENT, STATISTIC etc.) from data with missing values. sumskipnan implements the DIMENSION-argument for data with missing values. Also the second output argument return the number of valid elements (not NaNs)
the function flag_nans_occured() returns whether any value in x is a not-a-number (NaN)
features:
- can deal with NaN's (missing values)
- implements dimension argument.
- computes weighted sum