Borrar filtros
Borrar filtros

POSITIVE random numbers generation from object distributions

2 visualizaciones (últimos 30 días)
Gabs
Gabs el 20 de Oct. de 2015
Comentada: Gabs el 23 de Oct. de 2015
can I select only positive random numbers from a distribution? Even considering this distribution may have negative numbers in it
  2 comentarios
dpb
dpb el 20 de Oct. de 2015
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.
Gabs
Gabs el 23 de Oct. de 2015
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"

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by