How to get the LSB of a number?

조회 수: 12 (최근 30일)
Darsana P M
Darsana P M 2017년 9월 19일
댓글: Darsana P M 2017년 10월 19일
If suppose the number is 110110, how to get its LSB in matlab?
  댓글 수: 2
Jan
Jan 2017년 9월 19일
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 2017년 10월 19일
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?

댓글을 달려면 로그인하십시오.

채택된 답변

Geoff Hayes
Geoff Hayes 2017년 10월 19일
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);
  댓글 수: 1
Darsana P M
Darsana P M 2017년 10월 19일
Thanks for the answer.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by