Random numbers with specific sum and varying maximum
Mostrar comentarios más antiguos
How can I generate random numbers with a specific sum and a specific minimum (zero) but varying maximum? I already tried randfixedsum function but the maximum is fixed not varying.
Respuestas (1)
Jeff Miller
el 13 de Abr. de 2021
0 votos
How about first picking the maximum "thismax" randomly from whatever distribution you want, and then using randfixedsum to generate the remainder "desired_total-thismax" the remaining n-1 numbers?
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!