How to make a binary sequence bit with given key?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi I have a key (ex: key=1234;) how i create a binary sequence bit whose length is 1000 with this key?
0 comentarios
Respuesta aceptada
Walter Roberson
el 22 de Ag. de 2013
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.
3 comentarios
Walter Roberson
el 23 de Ag. de 2013
Do you mean Ӓ, capital A with two dots, Unicode position (decimal) 1234 ? Or do you mean just capital A ?
If you mean Ӓ, capital A with two dots then
vec = [1 0 0 1 1 0 1 0 0 1 0]; %you have the vector somehow
char(bin2dec(char('0' + vec)))
and the reverse would be
ch = char(1234); %you already have the character somehow
dec2bin(ch) - '0'
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!