Question: how to calculate the correlation matrix in matlab?
Answer: r=corrcoef(X) calculates a matrix r of correlation coefficients for an array X , in which each row is an observation, and each column is a variable. r=corrcoef(X,Y) , where X and Y are column vectors, is the same as r=corrcoef([X Y]) .