String to Cells

版本 1.1.0.1 (1.4 KB) 作者: Cole Stephens
Split a single string into a cell array.
2.5K 次下载
更新时间 2016/9/1

查看许可证

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'

引用格式

Cole Stephens (2026). String to Cells (https://ww2.mathworks.cn/matlabcentral/fileexchange/6054-string-to-cells), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R14SP1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Characters and Strings 的更多信息
致谢

启发作品: rsplit

版本 已发布 发行说明
1.1.0.1

Updated license

1.1.0.0

Updated License Info.

1.0.0.0