Using normrnd to generate a random sequence
2 次查看(过去 30 天)
显示 更早的评论
I'm trying to use the function 'normrnd' to generate a zero-mean random sequence distributed uniformly between +/- 0.25. How do I go about doing this?
0 个评论
采纳的回答
Roger Stafford
2018-2-12
The best answer to your question is, “don’t use ‘normrnd’ for that purpose!” It is very much the wrong distribution for that.
You should use ‘rand’ as follows:
x = 0.5*rand(m,n)-0.25;
This will give you a statistically uniform distribution between -0.25 and +0.25, and nowhere else.
更多回答(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!