假设我有一个字符数组,看起来像...
hello
hillo
hello
我想把它们转换成一个单元数组,这个数组与...
A = {'hello';'hillo';'hello'}
我该如何实现这个?我试过使用mat2cell,但它似乎只将所有内容放入一个大单元格中,并没有真正将它们分开。例如,如果我输入原始字符数组,它会像这样输出:
A = mat2cell(arrayofchars)
[3x5 char]
instead of the preferred output of...
'hello'
'hillo'
'hello'
抱歉如果我没有很好地解释我的问题!我对matlab还比较新!
谢谢!
cellstr
了吗? - Divakar