MATLAB: Standalone Desktop Apps in App Designer

app designer

Hello Engineers,
Recently, I designed an Application using MATLAB App Designer. I used various Matlab functions to process some data. After compiling and packaging the app into a Standalone Desktop App, the app couldn't run properly. It seems that the callbacks that use Matlab functions such as plot, polarplot, and surf don't work. Can anyone please interpret this problem to find out what I should do?
Thanks

Best Answer

I am able to reproduce what you are seeing. In the process, I've learned a couple things. First, the answer.
Symbolic functions (syms for example) cannot be compiled into standalone applications. See this answer post.
I did find how to get error messages from a standalone application. There is a setting at the bottom of the app creation window that allows you to create a log file. Expand the "Additional runtime settings" option and select "Create log file".
Doing so with your app captured the following errors:
Undefined function 'syms' for input arguments of type 'char'.
Error in main/dipole (line 112)
Error in main/PlotDataButton_3Pushed (line 590)
Error in appdesigner.internal.service.AppManagementService/tryCallback (line 330)
Error in matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 335)
Error while evaluating Button PrivateButtonPushedFcn.
This is how I got to looking into how to include symbolic functions in a standalone application, which led me to Steve Lord's reply (linked above)