Generate random samples from the multinomial distribution.
1
,
then the corresponding row of x will contain only NaN
values.
n = 10; p = [0.2, 0.5, 0.3]; x = mnrnd (n, p);
n = 10 * ones (3, 1); p = [0.2, 0.5, 0.3]; x = mnrnd (n, p);
n = (1:2)'; p = [0.2, 0.5, 0.3; 0.1, 0.1, 0.8]; x = mnrnd (n, p);
Package: statistics