MATLAB Answers

0

Generating random variable from certain standard deviation and mean

Asked by Alin Brad on 19 Jul 2019
Latest activity Answered by Alin Brad on 22 Jul 2019
Could you please help me how can I generate random variable from Gaussian distribution with zero mean and 0.3 standard deviation?

  2 Comments

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.

Sign in to comment.

3 Answers

Answer by Andrei Bobrov
on 19 Jul 2019
Edited by Andrei Bobrov
on 19 Jul 2019
 Accepted Answer

a = .3;% standard deviation
b = 0; % mean
out = a.*randn + b;

  0 Comments

Sign in to comment.


Answer by Torsten
on 19 Jul 2019

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

  0 Comments

Sign in to comment.


Answer by Alin Brad on 22 Jul 2019

Thank you alot guys for the helpful comments!

  0 Comments

Sign in to comment.