MATLAB Function Reference Previous page   Next Page
var

Variance

Syntax

Description

var(X) returns the variance of X for vectors. For matrices, var(X)is a row vector containing the variance of each column of X. var(X) normalizes by N-1 where N is the sequence length. The result V is an unbiased estimator of the variance of the population from which X is drawn, as long as X consists of independent, identically distributed samples.

var(X,1) normalizes by N and produces the second moment of the sample about its mean.

var(X,w) computes the variance using the weight vector w. The number of elements in s must equal the number of rows in X unless w = 1, which is treated as a short-cut for a vector of ones. The elements of w must be positive. var normalizes w by dividing each element in w by the sum of all its elements.

var(X,w,dim) takes the variance along the dimension dim of X. Pass in 0 for w to use the default normalization by N-1, or 1 to use N.

The variance is the square of the standard deviation (STD).

See Also

corrcoef, cov, mean, median, std


Previous page  vander varargin, varargout Next page

© 1994-2005 The MathWorks, Inc.