How to remove the least significant bit of a signed int16
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hasan Ghorbani
am 18 Aug. 2015
Beantwortet: blaat
am 18 Aug. 2015
I have a series of int16 values and I need to remove LSB out of them and make them 15 bits. How can I do that?
Note: I don't want to use any toolbox other than MATLAB's built-in ones.
0 Kommentare
Akzeptierte Antwort
blaat
am 18 Aug. 2015
You could use bitset() to set the LSB to 0, but they will still be 16-bits in memory. For example:
a = [56, 21, 33];
b = bitset(a, 1, 0);
then b will be
[56, 20, 32]
but still of type int16.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices 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!