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
% @iftex
% @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
% @end iftex
% @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 Sat 16-May-2009 00:04:49 by m2html © 2003