我需要与上字母输入句子,然后拆分句子的单词和字符的每一个字计数“一”拆分句子的单词和计数的字符数“A”中的每个字
我VE使这个
clear
sentences=input('Write your sentences: ','s');
low=lower(sentences);
disp('Sentences splitted to words: ');
words=regexp(low,' ','split');
for i=1:length(words)
disp(words(i))
end
现在我不知道如何计算每个分割后的单词“一”字,因为这些词被转换成细胞。 有人可以帮助我吗?
从这里开始:
您可以同样使用一个循环文档:[字符和字符串](http://www.mathworks.com/help/matlab/characters-and-strings.html) – horchler
没有必要在标题中人为插入标签;理想情况下,标题应该是连贯的句子 – 2015-06-24 20:11:04