所以我的代码是:
my5Sentences={'Windows machines are better than Macs.','The Intel core i7 4770k is a great processor.','My email is xxxxx@drexel.edu','I go to Drexel','I am writing this in MATLAB & and I writing this code for Engr-180'}
for 1:length(my5Sentences)
现在,我不知道在for循环中要做什么来索引句子并检查字符大小。
答案 0 :(得分:0)
使用函数“size”而不是for循环
答案 1 :(得分:0)
要编制索引,请使用{}运算符:
for i=1:(my5sentences)
fprintf('length(%s)=%i',my5Sentences{i},length(my5Sentences{i}))