For r = corr2(A,B)
(documentation):
it returns the correlation coefficient r between A and B, where A and B are matrices or vectors of the same size. r is a scalar double.
If you still want to use
corr2
, you can do like:result = corr2(A(1:10, :), B)
Solve: for matrices of different dimensions, you should use xcorr2
:
C = xcorr2(A, B)
- C = xcorr2(A,B) returns the cross-correlation of matrices A and B with no scaling. xcorr2 is the two-dimensional version of xcorr.