How to wait a keypress?

Answers (1)

Stephen23
Stephen23 on 20 Apr 2015
Edited: Stephen23 on 20 Apr 2015

0 votes

You can use pause to achieve this.

2 Comments

Mr M.
Mr M. on 20 Apr 2015
No, no! I would like to wait a specific character! For example pressing "a" to doing something and pressing "b" to do something else!
Stephen23
Stephen23 on 20 Apr 2015
Edited: Stephen23 on 20 Apr 2015
Then you could try using input, and calling switch with the value that the user inputs.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 20 Apr 2015

Edited:

on 20 Apr 2015

Community Treasure Hunt

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

Start Hunting!