MATLAB Answers


So how do you make MAtlab into a responding program?

Asked by Rainaire Hansford on 15 Sep 2013
Latest activity Commented on by Rainaire Hansford on 30 Sep 2013

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?


Log in to comment.

2 Answers

Answer by Walter Roberson
on 15 Sep 2013
 Accepted Answer

Use input with the 's' option to request the responses

din = input('What did you have for dinner?', 's');


Yeah that's not working like I planned any other suggestions.

if any(strcmpi(din, {'Hello', 'Hi', 'Whats up'}))

Log in to comment.

Answer by Rainaire Hansford on 20 Sep 2013

How do I make if and else statement equal to the words that I type.

  1 Comment

Log in to comment.

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today