필터 지우기
필터 지우기

How to generate 10 iid Gaussian random samples having mean 0 and variance 10. From the generated samples check the mean and the variance. Repeat the experiment for 100 samples, 1000 samples and so on.

조회 수: 13 (최근 30일)
How to solve this?

채택된 답변

Pratyush Roy
Pratyush Roy 2020년 10월 1일
Hi,
The following lines of code might be helpful:
mu = 0;
variance = 10;
num_sample = 1000;
sample_arr = mu+sqrt(variance)*randn(num_sample,1);
You can visit the following link to the documentation for randn function for further help:
Hope this helps!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by