在matlab和m中的新嘗試從MATLAB輸入gui將由用戶輸入並將該句子分成單詞,但我需要把它們作爲字母,因爲我使用機器人寫他們。這封信將發送給這些機器人。我使用兩個機器人,例如當我按下按鈕matlab函數時,在文本中輸入'lou reed'時,將這2個單詞保存到不同的字符數組中,以便我可以將字母c(i)這樣寫入併發送給處理。迄今爲止,我寫了這些,但ım卡住了。matlab將句子分成單詞
c = char(get(handles.edit1,'String'));
int count1;
int count2;
char word1;
char space=" ";
for i=1:length(c)
int t = isequal(c(i),space);
if(t==0)
count1=count1+1;
word1=;%ım trying to add the char here to find the new word
else
end
end
我不知道該怎麼辦ı搜索但我找不到有用的可能ı看起來不正確。 什麼將是有益的,thankss
這很好,謝謝 – amadeus