Get bits of number.
Show older comments
I have a 16 bit double I got from using wavread that I want to get the first 8 bits from.
As an example lets say I have 67. Inside my computer it must be represented as a series of bits, 0111001 in this case. So lets say that I just want to have the last for of them 1001.
How can this be done?
3 Comments
Guillaume
on 13 Apr 2015
You do not have a 16 bit double, since the double type is a 64-bit floating point number. single is 32-bit FP, and I'm not aware of a common 16-bit FP type.
You may have a 16-bit integer (signed or unsigned?)
Guillaume
on 13 Apr 2015
Also, 67 in binary is not 00111001:
>>dec2bin(67, 8)
ans = 0100011
Raldi
on 13 Apr 2015
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!