Here's another idea: for each line, you could generate 7 random numbers (from 0 to 1) and treat them like your "interval" locations - in other words, in your 8 random numbers, the sum of which is 1, these are your partial amount. Then you can sort them and accept the difference to get the random numbers obtained. Here is the code for what I think:
numrows = 100; partialsums = [zeros(numrows,1), rand(numrows,7), ones(numrows,1)]; partialsums = sort(partialsums, 2); randmat = diff(partialsums, 1, 2);
The distribution of numbers will vary depending on how you do it. I compared this method with the one published by Aabaz, and I got it for distribution.
So my view looks a little more exponential, you get some higher values, and its a bit more uniform, but with a lower clipping of the random numbers you get.
source share