delay on user input

Hi all,
I vant to delay on user input, meaning that if the user wont input something within lets say 10 sec than the vatiable will get a defult value.
this is a schematic code of what I want to do, how can I apply it on Matlab?
UserInput = input('please enter a variable value:\n ')
delay (10 sec)
if not (UserInput)
UserInput = 10
end

 Risposta accettata

Taylor
Taylor il 17 Apr 2024

0 voti

You can use uiwait with the "timeout" argument.

Più risposte (0)

Tag

Richiesto:

Sag
il 17 Apr 2024

Risposto:

il 17 Apr 2024

Community Treasure Hunt

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

Start Hunting!

Translated by