How can I convert decimal number to binary number

1 回表示 (過去 30 日間)
Abduellah Elbakoush
Abduellah Elbakoush 2021 年 12 月 29 日
回答済み: Voss 2021 年 12 月 29 日
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

採用された回答

Voss
Voss 2021 年 12 月 29 日
a = 32;
dec2bin(a,8) % use (at least) 8 bits
ans = '00100000'

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by