MATLAB: Normalized Correlation

correlationmatrixvector

I have a vector A 1×512 and a matrix M 512 x 512. I need to value the normalized correlation between A and the ith row of the matrix M.
I think:
corr_rows = zeros(1,512);
for i=1:512
Row = A(i,:);
corr_rows(i) = corr2(A,Row);
end
Is It correct? And the normalization?
Thanks!!!

Best Answer

Looks almost right to me, does it look right to you?
Hint: you need to change A to M in the assignment to row. Okay, that was a really nice hint.
Related Question