lar*_*ara 1 arrays string matlab text-processing text-parsing
我有一个s存储很长句子的字符串,我想将内容复制s到一个数组中C,每个单元格都存储一个句子.以下是我的代码,它没有给我任何输出,但是单元格的维度:
while(i<6)
C(i)=s;
end
Run Code Online (Sandbox Code Playgroud)
这是我打印时输出的方式C:
C=
[1x76 char]
Run Code Online (Sandbox Code Playgroud)
有人能帮帮我吗.
另一份工作strsplit:
>> sentences = 'This is the first one. Then here is a second. Yet another here.';
>> C = strsplit(sentences,'. ')
C =
'This is the first one' 'Then here is a second' 'Yet another here.'
Run Code Online (Sandbox Code Playgroud)
我们指定一个句点,后跟一个空格作为分隔符.根据需要更改此项.