String to Cells
Take a single string and separate out individual "elements" into a new cell array. Elements are defined as non-blank characters separated by spaces.
Similar to str2cell, except str2cell requires an array of strings. str2cells requires only 1 string.
Example: Consider the following string in the workspace:
aString = ' a b c d efgh ij klmnopqrs t u v w xyz '
>> newCell=str2cells(aString)'
newCell =
'a'
'b'
'c'
'd'
'efgh'
'ij'
'klmnopqrs'
't'
'u'
'v'
'w'
'xyz'
Cita come
Cole Stephens (2024). String to Cells (https://www.mathworks.com/matlabcentral/fileexchange/6054-string-to-cells), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- MATLAB > Language Fundamentals > Data Types > Characters and Strings >
- MATLAB > Language Fundamentals > Data Types > Data Type Conversion >
Tag
Riconoscimenti
Ispirato: rsplit
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.