Got Questions? Get Answers.
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

Thread Subject:
character to binary

Subject: character to binary

From: Alex Ter-Sarkissov

Date: 1 Aug, 2010 05:40:09

Message: 1 of 6

hi,

does anyone know how to convert characters into binary and back? I can easily do this with real numbers, but can't sort it out with characters.

cheers,

Alex

Subject: character to binary

From: Roger Stafford

Date: 1 Aug, 2010 06:09:05

Message: 2 of 6

"Alex Ter-Sarkissov" <ater1980@gmail.com> wrote in message <i331bp$q3p$1@fred.mathworks.com>...
> hi,
>
> does anyone know how to convert characters into binary and back? I can easily do this with real numbers, but can't sort it out with characters.
>
> cheers,
>
> Alex

http://en.wikipedia.org/wiki/ASCII

Subject: character to binary

From: Walter Roberson

Date: 1 Aug, 2010 07:24:22

Message: 3 of 6

Alex Ter-Sarkissov wrote:

> does anyone know how to convert characters into binary and back? I can
> easily do this with real numbers, but can't sort it out with characters.

Hint:

'abc123' + 0

Subject: character to binary

From: Alex Ter-Sarkissov

Date: 1 Aug, 2010 22:25:09

Message: 4 of 6

thanks, but is there a more straightforward command that transforms characters into binary and back, such as dec2bin?

cheers,

Alex

Subject: character to binary

From: Walter Roberson

Date: 1 Aug, 2010 22:43:17

Message: 5 of 6

Alex Ter-Sarkissov wrote:
> thanks, but is there a more straightforward command that transforms
> characters into binary and back, such as dec2bin?

What matlab version are you using?

 >> dec2bin('abc',8)
ans =
01100001
01100010
01100011

Subject: character to binary

From: Alex Ter-Sarkissov

Date: 1 Aug, 2010 23:21:05

Message: 6 of 6

great, thank you!

Walter Roberson <roberson@hushmail.com> wrote in message <9Mm5o.41715$OU6.24078@newsfe20.iad>...
> Alex Ter-Sarkissov wrote:
> > thanks, but is there a more straightforward command that transforms
> > characters into binary and back, such as dec2bin?
>
> What matlab version are you using?
>
> >> dec2bin('abc',8)
> ans =
> 01100001
> 01100010
> 01100011

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us