Random numbers with specific sum and varying maximum

2 Ansichten (letzte 30 Tage)
Mariam Sameh
Mariam Sameh am 12 Apr. 2021
Beantwortet: Jeff Miller am 13 Apr. 2021
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.

Antworten (1)

Jeff Miller
Jeff Miller am 13 Apr. 2021
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?

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by