timeout on input prompt

16 ビュー (過去 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 Center および File ExchangeWhos についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by