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!
You can use
// Create a 100x1 vector of // 1's and 0's with a mean of 0.7 x = rndBernoulli(100, 1, 0.7);