% Perfectly finctionally connected X and Y (from circle)
% are uncorrelated.
close all

s = RandStream('mt19937ar','Seed',0);
RandStream.setGlobalStream(s);
n=300;
x=[]; y=[];
for i=1:n
    phi = 2*pi*rand
    x=[x cos(phi)];  y=[y sin(phi)];
end
r=corr(x', y')  %0.0031
plot(x,y,'.')  

t = r*sqrt((n-2)/(1-r^2))     %0.0534
pval = 2*tcdf(-abs(t), n-2)   %0.9574

    
