I have a matrix say 'a' (3x6). According to the binomial distribution, I want to divide the sum of each row into a new matrix with two collumns (e.g. 'distribute1'). For this I use binornd but i want the values of the numbers generated to sum up to the value of the sum of each row. For example, let's say a row sums up to 5. The values generated by binornd should be either: 0 and 5, 1 and 4 or 2 and 3.
Is it correct to use binornd? Should I use binopdf?
If it helps, I am trying to make a script from a paper. This is wat it says: "the total RNAs in them [in my case it is equal to the sum of each row of 'a'] were distributed into two compartments [in my case 'distribute1,2 or 3'] according to the binomial distribution" 10.1038/s41559-018-0650-z
What is the logic for chosing the values of the n (no of trials) and p (probability of succes in each trial) input arguments? For now, I used the row sum as n and 0.5 as p. But I'm not sure if it is correct (these parameters are not mentioned in the paper).
Here is my code:
a=[1 2 3 4 5 6; 7 8 9 10 11 12; 13 14 15 16 17 18]