How can I convert decimal number to binary number

조회 수: 3 (최근 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 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