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