Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

convert to binary

Asked by huda nawaf

huda nawaf (view profile)

on 16 Aug 2011

hi, I need function convert integer to binary then alphabet.

what I must use to get that? thanks

1 Comment

Image Analyst

Image Analyst (view profile)

on 16 Aug 2011

What do you mean by "alphabet"?

huda nawaf

huda nawaf (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Paulo Silva

Paulo Silva (view profile)

on 16 Aug 2011
Accepted answer

Use the dec2bin function, the result is a string

0 Comments

Paulo Silva

Paulo Silva (view profile)

Answer by huda nawaf

huda nawaf (view profile)

on 16 Aug 2011

thanks, can I get binary number with fixed length? say with 10 bits for all numbers, then can serve my work

thanks

2 Comments

Paulo Silva

Paulo Silva (view profile)

on 16 Aug 2011

dec2bin(DecimalValue,nbits)

example

dec2bin(63,10)

Walter Roberson

Walter Roberson (view profile)

on 16 Aug 2011

Read the dec2bin documentation. Even R13SP2 had the necessary feature. http://www.mathworks.com/help/releases/R13sp2/techdoc/matlab.html

huda nawaf

huda nawaf (view profile)

Contact us