Effacer les filtres
Effacer les filtres

Extract the upper and the lower half of an integer

15 vues (au cours des 30 derniers jours)
suzi freunden
suzi freunden le 1 Juin 2012
Hi, is there a function that extract the upper half of an integer (most significants bits) and the lower half? Thanks

Réponses (2)

per isakson
per isakson le 1 Juin 2012
See: bitget
C = bitget(A, bit) returns the value of the bit at position bit in A.

Walter Roberson
Walter Roberson le 1 Juin 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.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by