フィルターのクリア

How to make the cursor go automatically to command window after hitting run (F5) in MATLAB R2016a?

15 ビュー (過去 30 日間)
When there is a user defined input, MATLAB's cursor would automatically go to the command window after hitting run and takes the input.
For some strange reason, in this version of MATLAB (i.e R2016a), I have to manually click on command window (or use CTRL+0) to shift MATLAB's focus.
I tried resetting MATLAB preferences but still doesn't work. I am not sure if other users had experienced a similar problem.
Any help on fixing this is greatly appreciated. Thanks!
  3 件のコメント
Roman Kuc
Roman Kuc 2016 年 6 月 9 日
In 2016a you must click on the Command window to move the cursor from the Editor window when running a program that contains an input command x = input('x= '); This is annoying - Previous versions brought the cursor to the Command window automatically so the user can respond to the prompt. In 2016a, the response shows in the editor. Is there a setting that fixes this?

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

採用された回答

Daniel
Daniel 2016 年 11 月 17 日
I found the solution. Use the command "commandwindow" before you run the "input" command. This will shift the focus (from whever it was) to the command window before asking for an input.
Example:
%%Insert in your script the following
commmandwindow;
input('Press ENTER to continue');
This has worked for me in Matlab R2016a
  3 件のコメント
David Cox
David Cox 2020 年 6 月 16 日
Ahh... my workflow just got so much better. Thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by