How do I stop my app from closing after messages are displayed?
10 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
prabhat kumar sharma
2025-1-23
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!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!