Why does my MATLAB application closes unexpectedly when no figure is open?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 1 Mär. 2017
Beantwortet: MathWorks Support Team
am 1 Mär. 2017
I have written an application consisting of several users interfaces. When one user interface/figure is closed, the visibility of a different figure is set from off to on. This works fine in MATLAB. However in a standalone application the new figure is not shown, the application closes. When opening the application from cmd.exe I see the following message:
Warning: 1 invisible figure(s) exist at MATLAB Runtime termination. The figure ID's of the remaining figures are:
If your application has terminated unexpectedly, please note that applications generated by the MATLAB Compiler terminate when there are no visible figure windows.
See documentation on how Standalone applications terminate for more information.
Akzeptierte Antwort
MathWorks Support Team
am 1 Mär. 2017
A standalone application ends when the end of the main function is reached or when there is no visible figure anymore. Since you close a figure before making the next figure visible, the standalone application ends. This behavior is intended. There are two ways you can ensure that the next GUI/figure is shown:
- Have some code running that runs till the next figure is set to visible
- Set the new figure to visible just before/while the original figure is closed
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!