| Statistics Toolbox | Search  Help Desk |
| nanmedian | Examples See Also |
Syntax
y = nanmedian(X)
Description
nanmedian(X) the median treating NaNs as missing values.
For vectors, nanmedian(x) is the median of the non-NaN elements of x. For matrices, nanmedian(X) is a row vector containing the median of the non-NaN elements in each column of X.
Example
m = magic(4);m([1 6 9 11]) = [NaN NaN NaN NaN]m =NaN 2 NaN 135 NaN 10 89 7 NaN 124 14 15 1nmedian = nanmedian(m)nmedian =5.0000 7.0000 12.5000 10.0000
See Also
nanmin, nanmax, nanmean, nanstd, nansum