Statistics Toolbox | ![]() ![]() |
Median value of vectors and matrices
Syntax
Description
calculates the median value, which is the 50th percentile of a sample. The median is a robust estimate of the center of a sample of data, since outliers have little effect on it.m = median(X)
For vectors, median(x)
is the median value of the elements in vector x
. For matrices, median(X)
is a row vector containing the median value of each column. Since median
is implemented using sort
, it can be costly for large matrices.
The median
function is part of the standard MATLAB language.
Examples
This example shows robustness of the median to outliers.
See Also
mean
, std
, cov
, corrcoef
![]() | mean | mle | ![]() |