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.

 Respuesta aceptada

Jan
Jan el 11 de Feb. de 2017
Editada: Jan el 11 de Feb. de 2017
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 comentario

uido
uido el 11 de Feb. de 2017
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Preguntada:

el 11 de Feb. de 2017

Comentada:

el 11 de Feb. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by