Why does my MATLAB application closes unexpectedly when no figure is open?

6 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 1 de Mzo. de 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

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by