Binary Bit Masking
40 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
その他の回答 (2 件)
Walter Roberson
2011 年 11 月 16 日
You could use bitand() and bitshift() too. Or just bitget().
Watch out for the bit numbering order that MATLAB uses.
3 件のコメント
thinnawat chumpuwiset
2018 年 8 月 17 日
i'm still confuse about bitget(), can you describe more detail?
Fangjun Jiang
2018 年 8 月 17 日
>> dec2bin(7,8)
ans =
'00000111'
>> bitget(7,1:8)
ans =
1 1 1 0 0 0 0 0
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Functions for Programming and Data Types についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!