add Gaussian distributed noise

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

0 个投票

2 个评论

I have been using it but not showing the same results
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