MATLAB Function Reference    
corrcoef

Correlation coefficients

Syntax

Description

S = corrcoef(X) returns a matrix of correlation coefficients calculated from an input matrix whose rows are observations and whose columns are variables. The matrix S = corrcoef(X) is related to the covariance matrix C = cov(X) by

corrcoef(X) is the zeroth lag of the covariance function, that is, the zeroth lag of xcov(x,'coeff') packed into a square array.

S = corrcoef(x,y) where x and y are column vectors is the same as corrcoef([x y]).

See Also

xcorr, xcov in the Signal Processing Toolbox, and:

cov, mean, std


 copyobj cos, cosh