From: Alex Ter-Sarkissov on
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
From: Roger Stafford on
"Alex Ter-Sarkissov" <ater1980(a)gmail.com> wrote in message <i331bp$q3p$1(a)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
From: Walter Roberson on
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
From: Alex Ter-Sarkissov on
thanks, but is there a more straightforward command that transforms characters into binary and back, such as dec2bin?

cheers,

Alex
From: Walter Roberson on
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