How to shift left a char array?
Mostrar comentarios más antiguos
I have 01111111 array. Now I want to left shift this array by 1 bit and it should delete the shifted MSB bit and should generate 0 as LSB . Output should be like 11111110. By using bitsll operator I am getting an extra bit like 011111110. How can I solve this problem. Can anyone please give me the solution ASAP.
Respuestas (1)
If you're manipulating char arrays (of '0' and '1') and not actual bits of a number then simply:
shiftedchararray = [yourchararray(2:end), '0']
1 comentario
RAKESH REDDY
el 14 de Mzo. de 2018
Editada: Stephen23
el 14 de Mzo. de 2018
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!