Newer
Older
msccd / matlabCode / correlation2.m
@Jan-Peter Hohloch Jan-Peter Hohloch on 23 Nov 2016 278 bytes first commit
function [R2]=correlation2(A,B)
% correlation2 calculates the elementwise squared correlation of two
% matrices
    if size(A)~=size(B)
        error('dimension mismatch')
    end
    R2=zeros(size(A,2),1);
    for i=1:size(A,2)
        R2(i)=corr(A(:,i),B(:,i)).^2;
    end
end