Correlation between two matrices

I have two matrices A and B both with same siez, i.e. 119*173.
What is the best way to find the correlation between those two?
I have tried couple of options, corr, corr2, corcoef etc.
It just gives a 2*2 NaN matrix, A and B have a lot of NaN's how to fix this

댓글 수: 4

Sophia
Sophia 2019년 11월 13일
What i understood from the link is it is not going to work for zeros and NaN's, I also checked at normxcorr2 but that's not somthing that i want.
Am i missing something from the link.
the cyclist
the cyclist 2019년 11월 13일
Can you also please be more clear about what you mean by the "correlation between two matrices"?
Do you expect one correlation coefficient, treating the matrices as 20,587x1 vectors that are simply shaped as 119x173?
Or do you expect 173 correlation coefficients -- one for each 119x1 column vector?
Or something else?

댓글을 달려면 로그인하십시오.

답변 (1개)

the cyclist
the cyclist 2019년 11월 13일

1 개 추천

One possibility, which ignores any element for which A or B is NaN, is
corrcoef(A,B,'rows','complete')

카테고리

질문:

2019년 11월 12일

답변:

2019년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by