Home > freetb4matlab > statistics > base > std.m

std

PURPOSE ^

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

SYNOPSIS ^

function retval = std (a, opt, dim)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} std (@var{x})
% @deftypefnx {Function File} {} std (@var{x}, @var{opt})
% @deftypefnx {Function File} {} std (@var{x}, @var{opt}, @var{dim})
% If @var{x} is a vector, compute the standard deviation of the elements
% of @var{x}.
% @tex
% $$
% {\rm std} (x) = \sigma (x) = \sqrt{{\sum_{i=1}^N (x_i - \bar{x})^2 \over N - 1}}
% $$
% where $\bar{x}$ is the mean value of $x$.
% @end tex
% @ifnottex
%
% @example
% @group
% std (x) = sqrt (sumsq (x - mean (x)) / (n - 1))
% @end group
% @end example
% @end ifnottex
% If @var{x} is a matrix, compute the standard deviation for
% each column and return them in a row vector.
%
% The argument @var{opt} determines the type of normalization to use.  Valid values
% are
%
% @table @asis 
% @item 0:
%   normalizes with @math{N-1}, provides the square root of best unbiased estimator of 
%   the variance [default]
% @item 1:
%   normalizes with @math{N}, this provides the square root of the second moment around 
%   the mean
% @end table
%
% The third argument @var{dim} determines the dimension along which the standard
% deviation is calculated.
% @seealso{mean, median}
% @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