Returns the median value of a matrix. Similar to mean.
Syntax |
Description |
---|---|
out = median(A); |
The median value of the matrix A is returned. Matrix should be real-valued and a warning is given if matrix A is not a vector. |
Example
Simple example showing how to find the mean value of a vector.
?median([-3, 2, 2, 1, 4]);
result:
2
?median([-3, 2, 1, 4]);
1.5
See Also