Use
result = binornd(m,b,R,C);
to generate an R
x C
matrix of random values drawn from an (m
,b
) binomial distribution.
If you then plot the histogram
hist(result(:),-.5:255.5)
you can check that (for R
and/or C
large enough) the obtained values follow the desired binomial distribution.