I am trying to find replacement of binornd function by standard MATLAB code. Is the following command
r = binornd(1,p,sz)
exactly equivalent to the:
function r = randb(p,sz)% simple bernoulli sampler
r = double(rand(sz) < p);end
If not, what is the correct equivalent?
Best Answer