Built-in Function: nansum (x)
Built-in Function: nansum (x, dim)
Built-in Function: nansum (…, "native")
Built-in Function: nansum (…, "double")
Built-in Function: nansum (…, "extra")

Compute the sum while ignoring NaN values.

nansum is identical to the sum function except that NaN values are treated as 0 and so ignored. If all values are NaN, the sum is returned as 0.

See help text of sum for details on the options.

See also: sum, nanmin, nanmax, nanmean, nanmedian.

Package: statistics