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?

how to conver a text to a matlab matrix or vector (every symbol in text fill one cell)

Asked by george

george (view profile)

on 7 Jan 2013

p.e i have this in text: himynameis george and i want this: [h,i,m,y,n,a,m,e,i,s, ,g,e,o,r,g,e]

or the askii bits of every symbol in every cell

thenks

0 Comments

george

george (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Image Analyst

Image Analyst (view profile)

on 7 Jan 2013
Accepted answer

Why do you want the complexity of a cell array when you have only one character per cell and a character array would work just fine?

characterArray = 'himynameis george'
asciiArray = int32(characterArray)

0 Comments

Image Analyst

Image Analyst (view profile)

Answer by Walter Roberson

Walter Roberson (view profile)

on 7 Jan 2013
num2cell('himynameis george')

0 Comments

Walter Roberson

Walter Roberson (view profile)

Contact us