Binary values

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

3 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 3 Mai 2012

0 Stimmen

uint8(bin2dec(TheString))
or use bitset()

Gefragt:

am 3 Mai 2012

Community Treasure Hunt

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

Start Hunting!

Translated by