time limit for input of data and automatic tranfer of control to next line if the time is exceeded
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a doubt Can we give time limit for an input statement. Eg:-a=input('name','s');
b=input('age','s');
Let us give 5 seconds for entering the name.after five seconds even if the name is entered or not the control will go to next line that is b without pressing enter key.
Is this possible??
Please give me some suggestions.
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 5월 30일
No, you cannot do that with an input() statement. Timers will not help: you might be able to get a timer to run but the timer will not be able to tell the input() statement to continue.
If you create a graphics dialog to get the value, then you can use uiwait() to wait for a response and use a timeout on it.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dynamic System Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!