add Gaussian distributed noise

조회 수: 3 (최근 30일)
Abdullah Ibrahim
Abdullah Ibrahim 2022년 9월 12일
편집: Chris 2022년 9월 12일
How to add Gaussian distributed noise with zero mean and standard deviation of 0.1 ?

답변 (1개)

Chris
Chris 2022년 9월 12일
편집: Chris 2022년 9월 12일
  댓글 수: 2
Abdullah Ibrahim
Abdullah Ibrahim 2022년 9월 12일
I have been using it but not showing the same results
Chris
Chris 2022년 9월 12일
편집: Chris 2022년 9월 12일
The same results as what?
If you want the distribution to be the same each run, you will need to seed the random number generator.
figure
tiledlayout(1,2)
s = rng;
r1 = normrnd(0,.1,50000,1);
nexttile
histogram(r1)
rng(s)
r2 = normrnd(0,.1,50000,1);
nexttile
histogram(r2)

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by