Some button in standalone app not working after being compiled (although code working well)
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bowei Li
el 9 de Mayo de 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 comentarios
Image Analyst
el 10 de Mayo de 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?
Respuesta aceptada
Steven Lord
el 10 de Mayo de 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.)
Más respuestas (0)
Ver también
Categorías
Más información sobre Package and Share Apps en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!