How do I stop my app from closing after messages are displayed?

11 visualizaciones (últimos 30 días)
Mário Sousa
Mário Sousa el 6 de En. de 2022
Respondida: prabhat kumar sharma el 23 de En. de 2025 a las 4:15
I am in the process of developing my first MATLAB app and decided to try the application compiler.
I've now installed my app, leaving just a few disp lines without a semicolon.
When I run it, the Windows command prompt closes immediately after my messages are shown.
What do I have to code to avoid this from happening?

Respuestas (1)

prabhat kumar sharma
prabhat kumar sharma el 23 de En. de 2025 a las 4:15
Hello Mário Sousa,
It sounds like your compiled MATLAB application is closing immediately after running, and you'd like it to remain open until you decide to close it. You can achieve this by wrapping your code in a `while` loop, which will keep the application running until a specific condition you define is met.
Here's a simple example:
while true
% Your application code here
% Condition to break the loop
if someCondition
break;
end
end
This loop will keep the application active until `someCondition` becomes true. You can define `someCondition` based on your application's logic or user input.
I hope this suggestion helps resolve the issue!

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by