How am I to generate random numbers with exponential distribution applied?
3 次查看(过去 30 天)
显示 更早的评论
How to generate random numbers with the exponential distribution applied, and also given a minimum value of 0.5, and a lambda of 0.2?
0 个评论
采纳的回答
Thomas Koelen
2015-4-30
pd = makedist('Exponential','mu', 0.2);
r=0.5+random(pd)
but this gives you values with 0.5 + a random number if you want just the numbers that are bigger than 0.5 do this:
pd = makedist('Exponential','mu', 0.2);
r=0;
while r<0.5
r=random(pd);
end
0 个评论
更多回答(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!