[問題] MATLAB 字串轉換 酬金200!!已回收
設計一個函數captalize.m其用法如下
outputStr = captalize(inputStr)
其中inputStr是一個輸入英文字串,函式會將此字串中,每個字的第一個字母改成大寫,
其餘是小寫,並將多個空格代換成一個空格,outputStr則是最後的字串。
請輸入字串 ‘you aRe mY sunshInE’
提示:請盡量使用strtok, upper, lower指令。
請將此字串
str = ‘Welcome to the Transactions on Audio, Speech and Language Processing
manuscript submission site. To Log In, enter your User ID and Password into
the boxes below, then click "Log In." If you are unsure about whether or not
you have an account, or have forgotten your password, enter your e-mail
address into the "Password Help" section to the right. If you do not have an
account, click on the "Create Account" link above.’
中所有子自串substr=‘you’的位置找出來,並依序將其位置的值儲存在x1,x2,x3,…的
變數(變數個數要自動控制)內。
Tip: 使用findstr和eval函數
酬金200!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.32.58
推
09/30 19:02, , 1F
09/30 19:02, 1F
→
09/30 19:58, , 2F
09/30 19:58, 2F
→
09/30 20:03, , 3F
09/30 20:03, 3F
推
09/30 20:10, , 4F
09/30 20:10, 4F
→
10/01 00:28, , 5F
10/01 00:28, 5F
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章