%% Random Columns of Matrix
% Compute the correlation coefficients for a matrix with two normally distributed, random columns and one column that is defined in terms of another. Since the third column of A is a multiple of the second, these two variables are directly correlated, thus the correlation coefficient in the (2,3) and (3,2) entries of R is 1.

x = randn(6,1);
y = randn(6,1);
A = [x y 2*y+3];
R = corrcoef(A)

% Copyright 2015 The MathWorks, Inc.