Random numbers that add to 100: Matlab

前端 未结 4 1843
死守一世寂寞
死守一世寂寞 2020-11-22 07:25

[I\'m splitting a population number into different matrices and want to test my code using random numbers for now.]

Quick question guys and thanks for your help in a

4条回答
  •  暖寄归人
    2020-11-22 08:18

    Take a list of N - 1 numbers, create a list of N + 1 numbers by inserting 0 and 100, sort the list, and diff them down to a total of N numbers.

提交回复
热议问题