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?

 Respuesta aceptada

Matt J
Matt J el 24 de Oct. de 2018
Editada: Matt J el 24 de Oct. de 2018
observations=randn(36,2)*sqrtm(C);
or,
observations=mvnrnd(zeros(36,2),C);

1 comentario

Kristoffer Linder
Kristoffer Linder el 24 de Oct. de 2018
First solution follow the theory from the prevous question. Thanks!!!

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2018a

Preguntada:

el 24 de Oct. de 2018

Editada:

el 24 de Oct. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by