Home > freetb4matlab > statistics > base > median.m

median

PURPOSE ^

% If @var{x} is a vector, compute the median value of the elements of

SYNOPSIS ^

function retval = median (a, dim)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} median (@var{x}, @var{dim})
% If @var{x} is a vector, compute the median value of the elements of
% @var{x}.  If the elements of @var{x} are sorted, the median is defined
% as
% @tex
% $$
% {\rm median} (x) =
%   \cases{x(\lceil N/2\rceil), & $N$ odd;\cr
%           (x(N/2)+x(N/2+1))/2, & $N$ even.}
% $$
% @end tex
% @ifnottex
%
% @example
% @group
%             x(ceil(N/2)),             N odd
% median(x) =
%             (x(N/2) + x((N/2)+1))/2,  N even
% @end group
% @end example
% @end ifnottex
% If @var{x} is a matrix, compute the median value for each
% column and return them in a row vector.  If the optional @var{dim}
% argument is given, operate along this dimension.
% @seealso{std, mean}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003