www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/BivariateNormalRandomNumbersExample.m

    %% Bivariate Normal Random Numbers  

%% 
% Generate values from a bivariate normal distribution with specified mean
% vector and covariance matrix. 
mu = [1 2];
sigma = [1 0.5; 0.5 2];
R = chol(sigma);
z = repmat(mu,10,1) + randn(10,2)*R