Matlab に 5 つの文字列を含むセルがあり、各文字列は文であり、Matlab コマンドを使用して各文の特殊文字の数と母音の数を引き出したいと考えています。どうすればいいですか?
これが私のコードです:
sentences={['Dogs are cool!'];['They love to have their bellies scratched!'];['They love to run around and play in the grass.'];['Each normal year is equal to seven dog years.'];['Its sad when dogs die.']}
sentences1=length(sentences{1})
sentences2=length(sentences{2})
sentences3=length(sentences{3})
sentences4=length(sentences{4})
sentences5=length(sentences{5})
fprintf('There are %d, %d, %d, %d characters in each sentence respectively. ', sentences1,sentences2,sentences3,sentences4,sentences5)