Home > freetb4matlab > statistics > base > mean.m

mean

PURPOSE ^

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

SYNOPSIS ^

function y = mean (x, opt1, opt2)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} mean (@var{x}, @var{dim}, @var{opt})
% If @var{x} is a vector, compute the mean of the elements of @var{x}
% @tex
% $$ {\rm mean}(x) = \bar{x} = {1\over N} \sum_{i=1}^N x_i $$
% @end tex
% @ifnottex
%
% @example
% mean (x) = SUM_i x(i) / N
% @end example
% @end ifnottex
% If @var{x} is a matrix, compute the mean for each column and return them
% in a row vector.
%
% With the optional argument @var{opt}, the kind of mean computed can be
% selected.  The following options are recognized:
%
% @table @code
% @item 'a'
% Compute the (ordinary) arithmetic mean.  This is the default.
%
% @item 'g'
% Compute the geometric mean.
%
% @item 'h'
% Compute the harmonic mean.
% @end table
%
% If the optional argument @var{dim} is supplied, work along dimension
% @var{dim}.
%
% Both @var{dim} and @var{opt} are optional.  If both are supplied,
% either may appear first.
% @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