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!