x and z are RV of gaussiana distribution and not correlated,
y is a RV of a gaussiana distribution and correlated with x
n=2^13;
x=randn(1,n)+3;
z=randn(1,n)+4;
y=zeros(1,n);
m=50;
for i =1:n-m
y(i)=mean(x(i:i+m-1));
end
plot([x(1:100)' y(1:100)']); grid
The density function:
[fx,kx]=hist(x,50);
fx=fx/sum(fx);
[fy,ky]=hist(y,50);
fy=fy/sum(fy);
plot(kx,fx,'b',ky,fy,'r');grid
and finally the distribution function:
Fx=cumsum(fx);
Fy=cumsum(fy);
plot(kx,Fx,'b',ky,Fy,'r');grid
If this code is helpful, please push the helped button. Thanks