Some button in standalone app not working after being compiled (although code working well)
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bowei Li
am 9 Mai 2022
Bearbeitet: Bowei Li
am 10 Mai 2022
Hi Community,
As in the title, we made an app using Matlab 2019b and I compiled it to be a standalone app.
Although the code works well (in Matlab 2019b), a certain button doesn't work after being compiled to be a standalone app. That is, if I'm using code, I push the button and the corresponding function runs; But if I use the standalone app I generated and push the button, nothing just happen.
I've checked that
- My Matlab runtime is R2019b 9.7.0.1737446 (the runtime was installed while I'm installing the app)
- I do included all files in the list for compiling.
Any hint for the potential reason is high appreciated!
3 Kommentare
Image Analyst
am 10 Mai 2022
Set breakpoints and see where it gets to. Also, why are you assigning msg and never using it? Can you attach the whole .mlapp file?
Akzeptierte Antwort
Steven Lord
am 10 Mai 2022
I believe if you launch the application from a system command prompt (Command Prompt on Windows, for example) rather than double-clicking the app icon in File Explorer then any error messages that the app generates will show in that prompt.
If you try it and that doesn't, you may want to send the app to Technical Support and work with them to determine what function or functions you're using that are not being packaged into the app.
Alternately for debugging purposes you could wrap those Function* calls in try / catch blocks and show a uialert window with the error information from the catch block. This may indicate the cause of the problem and lead to a workaround or solution. See the code below for an example of what I'm thinking using fprintf (since MATLAB Answers can't display a uialert window.)
try
x = (1:2)+(1:3);
fprintf("Success!\n")
catch ME
fprintf("Failure! Error message was:\n%s", ME.message)
end
Or if that's your actual code (with some lines elided) I did note one problem on closer inspection:
%{
[Outputs1] = Function1(Inputs1);
if Outputs
%}
You assign the Outputs1 but then test Outputs (no 1.)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Package and Share Apps finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!