Binary values

18 views (last 30 days)
Sujan
Sujan on 3 May 2012
How do I assign the value in Binary format to a uint8/uint16 variable ?
  3 Comments
Sujan
Sujan on 4 May 2012
for examples, I have to set a = '10101111'.
Walter Roberson
Walter Roberson on 4 May 2012
uint8(bin2dec(a))

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 3 May 2012
uint8(bin2dec(TheString))
or use bitset()

Community Treasure Hunt

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

Start Hunting!