divide text into smaller blocks text by . or enter
8 views (last 30 days)
Show older comments
if i want to separate content of a text into smaller parts according to "new line" or "."
how to do that?
such as 2 paragraphs , 1*1 matrix:
["Today is a good day. Mom cooks breakfast for us.
But I find out only my sister is served."]
into 2*1 matrix ,divided according to being paragraphed :
["Today is a good day. Mom cooks breakfast for us.";
"But I find out only my sister is served."]
or 3*1 matrix, divided according to being paragraphed and period"." :
["Today is a good day." ;
"Mom cooks breakfast for us.";
"But I find out only my sister is served."]
thanks for helping.
0 Comments
Accepted Answer
Steven Lord
on 3 Apr 2022
S = "Today is a good day. Mom cooks breakfast for us." + newline + ...
"But I find out only my sister is served."
T = split(S, newline);
T(1)
T(2)
More Answers (0)
See Also
Categories
Find more on Classical Mechanics 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!