Can someone help me with this?
Show older comments
I want to separate the word for the string vector by using loop. For example I have a str= 'hello,my,word' Then I want my result to be by using loop, so I can using index to call such as below: word(1)=hello word(2) = my word(3) = word I want to make it work in general case too. Can someone help me with this? Thank you
Accepted Answer
More Answers (1)
Walter Roberson
on 8 Oct 2017
0 votes
Breaking sentences into words is fairly difficult in some languages, including English. See https://www.mathworks.com/matlabcentral/answers/355353-how-to-scan-a-sentence-of-text-one-by-one-word-and-store-it-in-seperate-memory-location#comment_487942
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!