How can I reopen or re-run a GUI figure once I closed the window?

5 ビュー (過去 30 日間)
Fernando Venegas
Fernando Venegas 2016 年 10 月 5 日
コメント済み: Jan 2018 年 7 月 9 日
Hello,
I created a very simple GUI using GUIDE, every time I want to run it I go to the generated .m file and press the “Run” button in the editor. The problem is that if I close the GUI window, I am not able to reopen it. When I press “Run” again, I can see the right command on the “command window” but nothing happens, the GUI is not launched.
The only solution I have so far is to close MATLAB completely and then open my files again, but this is of course very annoying.
Do you have any suggestions?
Thanks for the help!
  1 件のコメント
Adam
Adam 2016 年 10 月 7 日
編集済み: Adam 2016 年 10 月 7 日
What happens if you instead run it from command line as e.g.
myGui = GUIName
where GUIName is obviously whatever you named your GUI.
Do you get an output on command line showing that myGUI is a figure? It is possible it is opening the figure off-screen though why it would do this only after closing it rather than always would be a mystery.

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

回答 (1 件)

Marc Jakobi
Marc Jakobi 2016 年 10 月 5 日
This is not normal behaviour. It sounds like there may be an infinite loop somewhere in your code. Does it say "busy" in the bottom left corner of the command window? If so, press CTRL+C to cancel any running code execution.
  4 件のコメント
Shae Morgan
Shae Morgan 2018 年 7 月 9 日
I have the same issue here... any ideas or help on this?
Jan
Jan 2018 年 7 月 9 日
@Shae Morgan: Please open a new thread and explain the problem again. How do you close the figure? What do you observe, when you set a breakpoint in the OpeningFcn and start the M-file?

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by