How can I convert decimal number to binary number

1 Ansicht (letzte 30 Tage)
Abduellah Elbakoush
Abduellah Elbakoush am 29 Dez. 2021
Beantwortet: Voss am 29 Dez. 2021
I have a= 32
if i use dec2bin(a ) the result is (10 0000)
But I don't want it's like that
I want the result is (0010 0000)
How I can do that

Akzeptierte Antwort

Voss
Voss am 29 Dez. 2021
a = 32;
dec2bin(a,8) % use (at least) 8 bits
ans = '00100000'

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by