Answer: https://stackoverflow.com/questions/64180034/matlab-how-to-divide-up-a-string-according-to-a-recurring-number/64183767#64183767
How to divide up a string according to a recurring number
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sean Combrink
am 3 Okt. 2020
Beantwortet: Sean Combrink
am 3 Okt. 2020
Here is an example of a piece of literate I want to divide up:
str = ["1 This is sentence one of verse one, "+ ...
"2 This is sentence one of verse two. "+ ...
"3 This is sentence two of verse three; "+ ...
"1 This is sentence three of verse one? "+ ...
"2 This is sentence four of verse two, "+ ...
"3 this is sentence four but verse three!"];
Notice how the numbers start over, this indicates a new chapter started. How can I make a nx1 string where n=chapters. This is what the results should look like:

Help is appreciated. Thanks!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Numeric Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!