POSITIVE random numbers generation from object distributions

can I select only positive random numbers from a distribution? Even considering this distribution may have negative numbers in it

2 个评论

Not a priori, no. You can reject elements returned either with resample or not (you code, not builtin functionality). But, of course, when you do that the result is no longer the same distribution as the parent.
effectively what worked was to create a while loop, so while random number is negative, the loop keeps pulling a new number from the distribution.
Another option is the command "truncate"

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Random Number Generation 的更多信息

提问:

2015-10-20

评论:

2015-10-23

Community Treasure Hunt

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

Start Hunting!

Translated by