add Gaussian distributed noise

18 vues (au cours des 30 derniers jours)
Abdullah Ibrahim
Abdullah Ibrahim le 12 Sep 2022
Modifié(e) : Chris le 12 Sep 2022
How to add Gaussian distributed noise with zero mean and standard deviation of 0.1 ?

Réponses (1)

Chris
Chris le 12 Sep 2022
Modifié(e) : Chris le 12 Sep 2022
  2 commentaires
Abdullah Ibrahim
Abdullah Ibrahim le 12 Sep 2022
I have been using it but not showing the same results
Chris
Chris le 12 Sep 2022
Modifié(e) : Chris le 12 Sep 2022
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)

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by