Hi there,
I need to simulate a binary distribution (ones and zeros) with mean=a, st. dev.=b and size=n.
Anyone know how to do that?
Thanks in advance!
1 Answer
0
You can use rndBernoulli
:
// Create a 100x1 vector of
// 1's and 0's with a mean of 0.7
x = rndBernoulli(100, 1, 0.7);
Your Answer
1 Answer
0
You can use rndBernoulli
:
// Create a 100x1 vector of
// 1's and 0's with a mean of 0.7
x = rndBernoulli(100, 1, 0.7);