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

New to MATLAB?

So how do you make MAtlab into a responding program?

Asked by Rainaire Hansford

Rainaire Hansford

on 15 Sep 2013
Latest activity Commented on by Rainaire Hansford

Rainaire Hansford

on 30 Sep 2013
Accepted Answer by Walter Roberson

Walter Roberson

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?

0 Comments

Rainaire Hansford

Rainaire Hansford

Products

2 Answers

Answer by Walter Roberson

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

7 Comments

Rainaire Hansford

Rainaire Hansford

on 29 Sep 2013

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

Walter Roberson

Walter Roberson

on 30 Sep 2013

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

Rainaire Hansford

Rainaire Hansford

on 30 Sep 2013

Awesome Thanks alot

Walter Roberson

Walter Roberson

Answer by Rainaire Hansford

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

Rainaire Hansford

on 30 Sep 2013

Awesome Thanks alot

Rainaire Hansford

Rainaire Hansford

Contact us