Extract the upper and the lower half of an integer
15 ビュー (過去 30 日間)
古いコメントを表示
Hi, is there a function that extract the upper half of an integer (most significants bits) and the lower half? Thanks
0 件のコメント
回答 (2 件)
per isakson
2012 年 6 月 1 日
See: bitget
C = bitget(A, bit) returns the value of the bit at position bit in A.
0 件のコメント
Walter Roberson
2012 年 6 月 1 日
For anything other than 8 bit integers, typecast() the integer into the unsigned integer type which is half of the size. You may have to deal with byte order problems, though.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!