function [R2]=correlation2(A,B)
    if size(A)~=size(B)
        error('dimension missmatch')
    end
    R2=zeros(size(A,2),1);
    for i=1:size(A,2)
        R2(i)=corr(A(:,i),B(:,i))^2;
    end
end