Global Index (short | long) | Local contents | Local Index (short | long)
[sx, nsum] = sum2 ( x ) ;
function [sx, nsum] = sum2 ( x ) ; Similar to SUM, but ignores missing values (NaNs). Output also the number of the valid values summed, so that an average can be calculated directly. See also: MEAN2
This function calls | |
---|---|
function [sx, nsum] = sum2 ( x ) ; sx=sum(zero_fillnan(x)); nsum=sum(~isnan(x));