| Statistics Toolbox | ![]() |
Syntax
Description
is the average computed by treating y = nanmean(X)
NaNs as missing values.
For vectors, nanmean(x) is the mean of the non-NaN elements of x. For matrices, nanmean(X) is a row vector containing the mean of the non-NaN elements in each column.
Example
m = magic(3);m([1 6 8]) = [NaN NaN NaN]m =NaN 1 63 5 NaN4 NaN 2nmean = nanmean(m)nmean =3.5000 3.0000 4.0000
See Also
nanmin, nanmax, nanmedian, nanstd, nansum
| nanmax | nanmedian | ![]() |