Generate random numbers with fixed sum and different constraints

But there is an error message if lo = [1 0 2 1 0] up = [5 6 4 4 2] and s = any number between 2 and 6.
2 and 6 is the max number whose both lower bounds are 0.
Can anybody help me to fix this problem?
Thanks.

1 Comment

That thread is fairly long. Please indicate which code you used out of it, and also please indicate which message it is within the thread. Look for the Message: 19 of 28 field in the header of the message.

Sign in to comment.

Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Asked:

on 17 Sep 2013

Community Treasure Hunt

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

Start Hunting!