Split String into Alphabets

조회 수: 2 (최근 30일)
Nil
Nil 2011년 11월 2일
Hi All,
I want split each alphabet from input string like
input_text='helloworld'
Then i want to split each alphabet till the end of string like
'h' 'e' 'l' like wise
Pls provide me some direction..
Thanks in Advance !!!
  댓글 수: 1
Jan
Jan 2011년 11월 2일
This is a confusing question. Actually the characters are separated already: 'hello' and ['h', 'e', 'l', 'l', 'o'] are exactly the same.

댓글을 달려면 로그인하십시오.

채택된 답변

Amith Kamath
Amith Kamath 2011년 11월 2일
you could access each element of the string by looking at input_text(i) where i varies from 1 to size(input_text,2).
for example, input_text(1:3) will give you 'hel';
For more sophisticated tasks, you may want to look into cell variables for they give a lot more flexibility.

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2011년 11월 2일
input_text'
or in cell array
cellstr(input_text')

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by