Cross correlation of Matrix columns

4 views (last 30 days)
Antonis Asiminas
Antonis Asiminas on 18 Apr 2018
Hi,
thank you in advance for taking the time to read this. I have a problem for which I'm sure there is an easy answer but I cannot find it. I have a matrix M (n,m). Each column represents a different experimenter and each row different score. I would like to correlate the scores of each experimenter with the scores of themselves and all other experimenters, and create effectively a new matrix Cor (m,m). It's element of this matrix will be a single value corresponding to the Pearson correlation between each column pair. The diagonal (from m,1 to 1,m) will contain the auto correlations of all columns of matrix M. I understand that have this square matrix is redundant (mirror to the other half) but it looks good when shown as a coloured correlation Matrix. I think I can do that with several lines of code but I'd like to know if there's an easy way.
Best, Antonis
  5 Comments
Antonis Asiminas
Antonis Asiminas on 18 Apr 2018
That makes absolute sense. I was so hung up on having the diagonal going from (size(M,2),1) to (1,size(M,2)) that I didn't see the easy answer. I'll just invert the matrix Cor I get and I'm done. Thank you very much! :)

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!