How do you use strsplit

4 次查看(过去 30 天)
Amanda
Amanda 2022-11-2
I need to use strsplit to transform txt data into a cell array but i dont know how to do this
  2 个评论
Matt J
Matt J 2022-11-2
What about the examples in the strsplit documentation?
KSSV
KSSV 2022-11-2
Show us your text.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2022-11-2
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'}

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by