MATLAB: How to make a binary sequence bit with given key

create bit sequence

Hi I have a key (ex: key=1234;) how i create a binary sequence bit whose length is 1000 with this key?

Best Answer

Convert the key to binary. repmat() that as many times as will fit in a vector of length 1000. Fill the remainder of the 1000 with binary 0's.