How to pause execution of program until a keypress
Mostrar comentarios más antiguos
Hi, I have two parts in my Matlab program and I want to pause first part until keypress event by user. I searched to pause function and found waitforbuttonpress. However I do not know how to use it. Can anyone suggest a good method to pause until a keypress or a specific keypress (y or Y) etc.? Thanks.
Respuesta aceptada
Más respuestas (2)
nl2605
el 12 de Mzo. de 2014
4 votos
the command 'pause'. It pauses the program until keypress.
Davide Rambusi
el 30 de Nov. de 2016
0 votos
is there a faster way? in my case, I have to run my code 200 times, and at some point, it gets really slow. I checked with the profile command, and it seems that pause could be the problem
1 comentario
Steven Lord
el 30 de Nov. de 2016
A faster way to wait an arbitrary amount of time until the user presses a key? No.
If you show your code (perhaps as a new question) we may be able to offer suggestions how to improve the performance of your code and avoid whatever is causing your code to take more time with each iteration.
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!