필터 지우기
필터 지우기

timeout on input prompt

조회 수: 15 (최근 30일)
Azura Hashim
Azura Hashim 2018년 8월 18일
답변: Jan 2018년 8월 20일
Hi,
I need to implement a timeout on an input prompt. I have found similar questions but all the answers implement a dialog box. Can someone point out how to implement the timeout on a plain command line input prompt? Thanks.
  댓글 수: 2
Haritha
Haritha 2018년 8월 18일
편집: dpb 2018년 8월 18일
dpb
dpb 2018년 8월 18일
timeout functions only for an instrument object; has nothing to do with user input/output...

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2018년 8월 20일
You can try to use a timer and FEX: inputemu to emulate the pressing of the Return key after a certain delay. This needs some tricks to distinguish it from regular hit of Return e.g. if the user tried to input "1.23" but the timeout sends the key after "1.2" already.
I would certainly stay away from such tricks. Such magic behavior can be very annoying, when it disturbs the user input. The command window is not the right location for such smart tricks.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by