Filter löschen
Filter löschen

How to get the LSB of a number?

9 Ansichten (letzte 30 Tage)
Darsana P M
Darsana P M am 19 Sep. 2017
Kommentiert: Darsana P M am 19 Okt. 2017
If suppose the number is 110110, how to get its LSB in matlab?
  2 Kommentare
Jan
Jan am 19 Sep. 2017
Please explain what the class of your "110110" is. Is it a char vector '110110' or a double vector [1,1,0,1,1,0]? Is it a logical vector or the binary representation of the number scalar double 54? Is the value store in LSB first order or the other way around? All these details cannot be guessed.
Darsana P M
Darsana P M am 19 Okt. 2017
It is actually a vector x=[1 1 0 1 1 0]
Sorry for not mentioning the class. If so,how to get the LSB of this array?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Geoff Hayes
Geoff Hayes am 19 Okt. 2017
Darsana - if x is your array of bits (presumably that is what it is) then the least significant bit (LSB) is the right-most bit
lsb = x(end);

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by