flushing the keyboard input after a pause.
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jon Rozeay
am 1 Nov. 2022
Beantwortet: Jon Rozeay
am 2 Nov. 2022
Hello,
I need to ignore the possible keyboard input during a pause. So for example:
i1 = input(' Enter first number : ')
pause(10)
i2 = input(' Enter second number : ')
I would like to ignore all the number that has been enter during the 10 second break.
So far, i2 will take whatever first number has been enter after i1.
This is driving me crazy thanks for your help,
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (2)
Jan
am 1 Nov. 2022
The command window does not offer a way to flush the input buffer. But this window is a bad way to implement a user interface, if a specific behavior is wanted.
Create your own GUI instead. Then you have full control over the focus, the contents of edit fields and the behavior during a pause. The command window is not useful as a general prupose GUI.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Desktop finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!