Generate 2-dimensional normal-distribution

조회 수: 5 (최근 30일)
Kristoffer Linder
Kristoffer Linder 2018년 10월 24일
편집: Matt J 2018년 10월 24일
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일
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

Community Treasure Hunt

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

Start Hunting!

Translated by