How to use 'randi' in MATLAB to generate equally probable samples which are either 0 or 1? How can I use ‘randi’ function in MATLAB to generate a signal sequence s(t) which contains 1e6 samples which are either 0 or 1 and are equally probable. Any suggestions? Thanks!
Generate random integer uniformly distributed between 1 or 2. Then you can shift it to your liking.
X=randi(2,size,1)-1