Generating random variable from certain standard deviation and mean

Could you please help me how can I generate random variable from Gaussian distribution with zero mean and 0.3 standard deviation?

2 comentarios

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.
Fair point. The finer points of math are not my strong suit, so I was going based on the title.

Iniciar sesión para comentar.

 Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 19 de Jul. de 2019
Editada: Andrei Bobrov el 19 de Jul. de 2019
a = .3;% standard deviation
b = 0; % mean
out = a.*randn + b;

Más respuestas (2)

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

Categorías

Más información sobre Random Number Generation en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 19 de Jul. de 2019

Respondida:

el 22 de Jul. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by