how can i do this?

2 次查看(过去 30 天)
bob  shot
bob shot 2012-12-12
Write a program that reads a string of characters, say a piece of an article in a magazine, and determines how many times each vowel appears in the passage.
  6 个评论

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2012-12-12
Here's a few hints for you, assuming you just type in the text from the article into your m-file:
s = 'abcdefGHIJKLmnopqRSTUVwxyz'
letterIndex = lower(s) - 'a'
% Now look up the hist() function
That should be enough to start you off.
  1 个评论
Walter Roberson
Walter Roberson 2012-12-12
Though it is admittedly tricky to figure out when "y" is a vowel and when it is a consonant.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by