How do you use strsplit

3 views (last 30 days)
Amanda
Amanda on 2 Nov 2022
Answered: Image Analyst on 2 Nov 2022
I need to use strsplit to transform txt data into a cell array but i dont know how to do this
  2 Comments
Matt J
Matt J on 2 Nov 2022
What about the examples in the strsplit documentation?
KSSV
KSSV on 2 Nov 2022
Show us your text.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 2 Nov 2022
For example
s = 'I need to use strsplit to transform txt data into a cell array but i dont know how to do this';
words = strsplit(s, ' ')
words = 1×21 cell array
{'I'} {'need'} {'to'} {'use'} {'strsplit'} {'to'} {'transform'} {'txt'} {'data'} {'into'} {'a'} {'cell'} {'array'} {'but'} {'i'} {'dont'} {'know'} {'how'} {'to'} {'do'} {'this'}

Categories

Find more on Characters and Strings in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!