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

4 views (last 30 days)
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 Comment
Adam
Adam on 7 Oct 2016
Edited: Adam on 7 Oct 2016
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.

Sign in to comment.

Answers (1)

Marc Jakobi
Marc Jakobi on 5 Oct 2016
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 Comments
Jan
Jan on 9 Jul 2018
@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?

Sign in to comment.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!