Is it possible for the Command Window to be active when plotting figures and waiting for user input in MATLAB?

5 次查看(过去 30 天)
Is it possible for the Command Window to be active when plotting figures and waiting for user input in MATLAB?
When I am plotting figures, they usually cover the Command Window. Therefore, if I have an INPUT command in the script for user interaction, it is blocked by the figure. Is there a suitable way of calling the Command Window to the foreground when user input is requested?

采纳的回答

MathWorks Support Team
This can be done by calling the UIMENUFCN function. For example:
h=uicontrol('style','push','call','uimenufcn(gcf,''WindowCommandWindow'')')
Create a figure and execute the above command. Then bring the figure window in front of the Command Window and press the pushbutton. The Command Window will be brought in front of the figure window.
NOTE: The UIMENUFCN function is not documented and we cannot provide technical details regarding UIMENUFCN.
An alternative workaround would be dock the figure windows so that they do not cover the command window. This can be set as a default using the following command:
set(0,'defaultfigurewindowstyle','docked');
Upon execution of this command on the MATLAB command prompt, subsequent figure windows will be docked.
One can also bring focus to the command line with a shortcut key which is by default mapped to the following key combination.
CTRL + 0
PLEASE NOTE: This shortcut does not work when the focus is on the figure, but works when the focus is on other components in MATLAB like the help documentation or the editor.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by