Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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?


Rainaire Hansford


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');


Rainaire Hansford on 29 Sep 2013

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

Walter Roberson on 30 Sep 2013

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

Rainaire Hansford on 30 Sep 2013

Awesome Thanks alot

Walter Roberson
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

Rainaire Hansford on 30 Sep 2013

Awesome Thanks alot

Rainaire Hansford

Contact us