Binary Bit Masking
37 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nevin
el 16 de Nov. de 2011
Respondida: Fangjun Jiang
el 17 de Ag. de 2018
What is the easiest way to bit mask a 16 bit binary value to decode different fields (2 bit, 4 bit, etc) with it? Thanks
0 comentarios
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 16 de Nov. de 2011
You could use bitand() and bitshift() too. Or just bitget().
Watch out for the bit numbering order that MATLAB uses.
3 comentarios
thinnawat chumpuwiset
el 17 de Ag. de 2018
i'm still confuse about bitget(), can you describe more detail?
Fangjun Jiang
el 17 de Ag. de 2018
>> dec2bin(7,8)
ans =
'00000111'
>> bitget(7,1:8)
ans =
1 1 1 0 0 0 0 0
0 comentarios
Ver también
Categorías
Más información sobre Functions for Programming and Data Types en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!