Statistics Toolbox | ![]() ![]() |
Syntax
Description
is the average computed by treating y = nanmean(X)
NaN
s
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 6
3 5 NaN
4 NaN 2
nmean = nanmean(m)
nmean =
3.5000 3.0000 4.0000
See Also
nanmin
, nanmax
, nanmedian
, nanstd
, nansum
![]() | nanmax | nanmedian | ![]() |