Newer
Older
masterarbeit / usedMcode / correlation2.m
@JPH JPH on 16 Nov 2016 278 bytes comment code
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