Generating random variable from certain standard deviation and mean

86 vues (au cours des 30 derniers jours)
Alin Brad
Alin Brad le 19 Juil 2019
Could you please help me how can I generate random variable from Gaussian distribution with zero mean and 0.3 standard deviation?
  2 commentaires
John D'Errico
John D'Errico le 19 Juil 2019
Bob - Note that the page you are sending them too is a question asking how to generate numbers that have a truncated normal distribution. That is different.
Bob Thompson
Bob Thompson le 19 Juil 2019
Fair point. The finer points of math are not my strong suit, so I was going based on the title.

Connectez-vous pour commenter.

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 19 Juil 2019
Modifié(e) : Andrei Bobrov le 19 Juil 2019
a = .3;% standard deviation
b = 0; % mean
out = a.*randn + b;

Plus de réponses (2)

Torsten
Torsten le 19 Juil 2019
n = 100;
x = 0.3*randn(n,1)
generates 100 normally distributed random numbers with mean 0 and standard deviation 0.3.

Alin Brad
Alin Brad le 22 Juil 2019
Thank you alot guys for the helpful comments!

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by