Write a function called WordProduct to calculate the alphabetic word product of a character vector.
2 ビュー (過去 30 日間)
古いコメントを表示
Please can you help me about this question... It is really important to me.
Write a function called WordProduct to calculate the alphabetic word product of a character vector. The input will be a character vector consisting of upper and lower case characters, and could be of any length. The alphabetic word product is the product of a number based on the correspondence to letters and is independent of the case of the letter, such as a=1, b=2, ... z=26. Ex: If the character vector is 'aBc', the word product is 6. Restrictions: The function may not use loops, and should make use of the function prod.
2 件のコメント
James Tursa
2018 年 12 月 21 日
What have you done so far? What specific problems are you having with your code?
Walter Roberson
2018 年 12 月 21 日
回答 (1 件)
James Tursa
2018 年 12 月 21 日
Hints to get you started:
- Look at the upper( ) and lower( ) functions
- What happens if you subract 'a' or 'A' from your vector?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!