Some button in standalone app not working after being compiled (although code working well)
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
Image Analyst
2022-5-10
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?
采纳的回答
Steven Lord
2022-5-10
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.)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Package and Share Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!