Display editable text on console

How can I send a text string to the console, and allow the user to edit it before executing, like the "Did you mean" mechanism.

 採用された回答

Jan
Jan 2017 年 2 月 11 日
編集済み: Jan 2017 年 2 月 11 日

1 投票

CmdWinTool('toFocus'); % Guarantee that command window has the focus
inputemu('key_normal', 'hello');
Perhaps FEX: textinject helps also.
Note: I would not use Matlab's command window for fancy editing actions, because it has a limited power only. Creating an own text interface in a figure can be more powerful.

1 件のコメント

uido
uido 2017 年 2 月 11 日
inputemu() does the trick. I am using linux so can't use CmdWinTool() to set the focus on the console. Anyway, in my spceific case I'm running the script from the console so this is not a problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

質問済み:

2017 年 2 月 11 日

コメント済み:

2017 年 2 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by