Statistics Toolbox
  Go to function:
    Search    Help Desk 
cov    See Also

Covariance matrix.

Syntax

Description

cov computes the covariance matrix. For a single vector, cov(x) returns a scalar containing the variance. For matrices, where each row is an observation, and each column a variable, cov(X) is the covariance matrix.

The variance function, var(X) is the same as diag(cov(X)).

The standard deviation function, std(X) is equivalent to
sqrt(diag(cov(X))).

cov(x,y), where x and y are column vectors of equal length, gives the same result as cov([x y]).

Algorithm

The algorithm for cov is

See Also

corrcoef, mean, std, var
xcov, xcorr in the Signal Processing Toolbox

cov is a function in MATLAB.



[ Previous | Help Desk | Next ]