corrcoef
Correlation coefficients
📝 Syntax
R = corrcoef(M)
📥 Input argument
M - a vector or matrix
📤 Output argument
R - Correlation coefficients of M.
📄 Description
R = corrcoef(M) returns the matrix of correlation coefficients for M, where the columns of M represent random variables and the rows represent observations.
The Pearson correlation coefficient between variables
and
is:
where
and
are the sample means, and
,
are the standard deviations.
The correlation coefficient ranges from -1 to +1, where -1 indicates perfect negative correlation, +1 indicates perfect positive correlation, and 0 indicates no linear correlation.
💡 Example
M = [4 -7 3; 1 4 -2; 10 7 9];
R = corrcoef(M)🔗 See also
🕔 History
Version
📄 Description
1.0.0
initial version
Last updated
Was this helpful?