Signal Processing Toolbox | ![]() ![]() |
Compute the correlation coefficient matrix.
Syntax
C=
corrcoef(X) C=
corrcoef(X,Y)
Description
corrcoef
returns a matrix of correlation coefficients calculated from an input matrix whose rows are observations and whose columns are variables. If C = cov(X)
, then corrcoef(X)
is the matrix whose element (i, j) is
C
is the zeroth lag of the covariance function, that is, the zeroth lag of =
corrcoef(X)
xcov(x,'coeff')
packed into a square array.
C
is the same as =
corrcoef(X,Y)
corrcoef([X Y])
; that is, it concatenates X
and Y
in the row direction before its computation.
corrcoef
removes the mean from each column before calculating the results. See the xcorr
function for cross-correlation options.
The corrcoef
function is part of the standard MATLAB language.
See Also
cov |
Covariance matrix. |
mean |
Average value (see the MATLAB documentation). |
median |
Median value (see the MATLAB documentation). |
std |
Standard deviation (see the MATLAB documentation). |
xcorr |
Cross-correlation function estimate. |
xcov |
Cross-covariance function estimate (equal to mean-removed cross-correlation). |
![]() | convmtx | corrmtx | ![]() |