So how do you make MAtlab into a responding program?

7 ビュー (過去 30 日間)
Rainaire Hansford
Rainaire Hansford 2013 年 9 月 15 日
コメント済み: Rainaire Hansford 2013 年 9 月 30 日
I Want to make a program that can respond back to you with words. I found one way but its annoying. I need to put (' ') Around the words I type and the it response but I just want to type the words and it give off a correct responses. Any good examples to make this work?

採用された回答

Walter Roberson
Walter Roberson 2013 年 9 月 15 日
Use input with the 's' option to request the responses
din = input('What did you have for dinner?', 's');
  7 件のコメント
Walter Roberson
Walter Roberson 2013 年 9 月 30 日
if any(strcmpi(din, {'Hello', 'Hi', 'Whats up'}))
Rainaire Hansford
Rainaire Hansford 2013 年 9 月 30 日
Awesome Thanks alot

サインインしてコメントする。

その他の回答 (1 件)

Rainaire Hansford
Rainaire Hansford 2013 年 9 月 20 日
How do I make if and else statement equal to the words that I type.

カテゴリ

Help Center および File ExchangeLive Scripts and Functions についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by