Compute correlation.
The (i, j)-th entry of
cor (
x,
y)
is the correlation between the i-th variable in x and the j-th variable in y.corrcoef(x,y) = cov(x,y)/(std(x)*std(y))For matrices, each row is an observation and each column a variable; vectors are always observations and may be row or column vectors.
cor (
x)
is equivalent tocor (
x,
x)
.Note that the
corrcoef
function does the same ascor
.