Generating random variable from certain standard deviation and mean
83 次查看(过去 30 天)
显示 更早的评论
Could you please help me how can I generate random variable from Gaussian distribution with zero mean and 0.3 standard deviation?
2 个评论
John D'Errico
2019-7-19
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
2019-7-19
Fair point. The finer points of math are not my strong suit, so I was going based on the title.
采纳的回答
Andrei Bobrov
2019-7-19
编辑:Andrei Bobrov
2019-7-19
a = .3;% standard deviation
b = 0; % mean
out = a.*randn + b;
0 个评论
更多回答(2 个)
Torsten
2019-7-19
n = 100;
x = 0.3*randn(n,1)
generates 100 normally distributed random numbers with mean 0 and standard deviation 0.3.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!