Is it possible for the Command Window to be active when plotting figures and waiting for user input in MATLAB?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
Réponse acceptée
MathWorks Support Team
le 27 Avr 2012
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!