Bit setting a binary number
显示 更早的评论
Is there any way to set specific bits in a binary number in Matlab.
I'm currently converting a number into a binary string using the dec2bin function, I then want to change the lower 6 bits.
ie
dec2bin(3124)
ans = 110000110100
I need to set the lower 6 bits to be 100000, resulting in:
ans = 110000100000
Is this possible?
Thanks, Ben
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!