所以我的代码是:
my5Sentences={'Windows machines are better than Macs.','The Intel core i7 4770k is a great processor.','My email is rjoshi8@drexel.edu','I go to Drexel','I am writing this in MATLAB & and I am writing this code for Engr-180'};
for i=1:length(my5Sentences)
fprintf('The total number of characters in this sentence is %i\n',length(my5Sentences{i}))
end
这部分代码显示了每个句子中有多少个字符,但是现在我需要找出每个句子中有多少个特殊字符。我不确定这个代码会是什么样子。顺便说一句,感谢 PearsonArtPhoto 帮助我解决了最初的问题。