Binary values

How do I assign the value in Binary format to a uint8/uint16 variable ?

3 Comments

James Tursa
James Tursa on 3 May 2012
Please be more specific. Give us a detailed example of sample input and desired output.
Sujan
Sujan on 4 May 2012
for examples, I have to set a = '10101111'.
uint8(bin2dec(a))

Sign in to comment.

Answers (1)

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

Asked:

on 3 May 2012

Community Treasure Hunt

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

Start Hunting!