MATLAB: Random Binary Sequence Generator

binary operationMATLAB

I need to generate a Random Binary Sequence of 1×10000 size. Purely Random 1's and 0's.
I had implemented it as follows and it does the job with no complaints.
rand_bin = round(0.75*rand(1,10000));
However, are there any Efficient Implementations for this, probably a specific function which was built for this or something?
Thanks.

Best Answer

use randi()
x = randi([0 1],10000,1);