Based on the code below, how do I create an vector y with "n" random elements chosen from two values bit1 and bit0? In the code below, I manually created y vector, but I want to input like n=50 and then have a "y" vector with a random sequence of bit1 and bit0 in 50 elements.
bit1 = ones(1,Fs);
bit0 = -ones(1,Fs);
y = [bit1 bit0 bit1 bit0 bit1];
Thank you very much,