MATLAB: Generate 2-dimensional normal-distribution

covariance-matrixhomeworkMATLABnormal distribution

I want to generate 36 observations from a 2-dimensional normal distribution using the covariance matrix
C = [1 0.8;0.8 1];
Anyone know how to do this?

Best Answer

observations=randn(36,2)*sqrtm(C);
or,
observations=mvnrnd(zeros(36,2),C);