Extract the upper and the lower half of an integer
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, is there a function that extract the upper half of an integer (most significants bits) and the lower half? Thanks
0 Kommentare
Antworten (2)
per isakson
am 1 Jun. 2012
See: bitget
C = bitget(A, bit) returns the value of the bit at position bit in A.
0 Kommentare
Walter Roberson
am 1 Jun. 2012
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 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!