Generate 2-dimensional normal-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?

 採用された回答

Matt J
Matt J 2018 年 10 月 24 日
編集済み: Matt J 2018 年 10 月 24 日

0 投票

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

1 件のコメント

Kristoffer Linder
Kristoffer Linder 2018 年 10 月 24 日
First solution follow the theory from the prevous question. Thanks!!!

サインインしてコメントする。

その他の回答 (0 件)

製品

リリース

R2018a

質問済み:

2018 年 10 月 24 日

編集済み:

2018 年 10 月 24 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by