x = randn(100, 1);
% Put whatever dependency of x you want and see
% how correlation changes
y = 3*x;
z = 4 + x.^3;
c1 = xcorr(x, y, 'coeff');
c2 = xcorr(x, z, 'coeff');
figure(1);
x_axis = -99:99;
plot(x_axis, c1, x_axis, c2, 'r');
legend('y = 3*x', 'z = 4 + x^3');

figure(2);

% Lets try to create an 'independent' from x
% vector. We can't be 100% accurate because
% randn returns pseudorandom values and
% not random.
y = randn(100, 1);
c1 = xcorr(x, y, 'coeff');
c2 = xcorr(x, z, 'coeff');
plot(x_axis, c1, x_axis, c2, 'r');
legend('y = randn(100, 1)', 'z = 4 + x^3');