median — median (row median, column median,...) of vector/matrix/array entries
y=median(x) y=median(x,'r') y=median(x,'c') y=median(x,'m') y=median(x,dim)
For a vector or a matrix x
, y=median(x)
returns in the scalar y
the median of all the entries of
x
.
y=median(x,'r')
(or, equivalently,
y=median(x,1)
) is the median along the row index. It returns
in each entry of the column vector y
the median of each
column of x
.
y=median(x,'c')
(or, equivalently,
y=median(x,2)
) is the median along the column index. It
returns in each entry of the row vector y
the median of each
row of x
.
y=median(x,'m')
is the median along the first non
singleton dimension of x
(for compatibility with matlab).
y=median(x,dim)
is the median along the dimension
dim
of x
(for compatibility with matlab).