How can I convert decimal number to binary number

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by