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?

 Akzeptierte Antwort

Matt J
Matt J am 24 Okt. 2018
Bearbeitet: Matt J am 24 Okt. 2018

0 Stimmen

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

1 Kommentar

First solution follow the theory from the prevous question. Thanks!!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by