Standalone Desktop Apps in 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

2 Comments

Hi Taha,
You should run the app with Console Window on, you'll get output and the errors that happen during the run. Please use search tool to find out how to enable it.
Hi Mario, Thanks for your reply.
Can you tell me what exactly the Console Window is? and how to run it?

Sign in to comment.

 Accepted 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)

More Answers (1)

It is possible to create an app that can run on a system that does not even have MATLAB installed, so the errors you report seem odd. Can you confirm that is the case after following the instructions provided here? If so, please share your standalone app (use the paperclip icon to attach it).

15 Comments

Yes, I have followed the steps provided by MATLAB. I have compiled the code using MATLAB compiler and packaged all required files for the app to run properly into one app. I can't attach the standalone app here since it has the MATLAB runtime embedded in it. So, can I recompile the app without the runtime files?
Let's start with just the error messages. Can you you copy/paste the error messages you are getting?
The problem is that I can't see any error messages. The app is running, but when I press the button that should plot some data, I hear a sound of error but can't see anything. Is there a way to trace the errors of standalone apps when the machine doesn't have MATLAB installed?
Does the app run correctly in MATLAB? When you run it from within add designer?
What is your MATLAB version and OS?
The app works fine within MATLAB App Designer environment. MATLAB Version is 2018a and the OS is Windows 10.
And what OS are you trying to run the standalone app in?
Can you attach your mlapp file? I can at least see if I can duplicate the issue here. If there is a datafile, please include that (or something that can be used to text the app). Use the paperclip icon to attach them.
Windows 10 too.
Here's the mlapp file
Here's the error message I see.
Error using matlab.ui.control.internal.model.mixin.IconableComponent/set.Icon (line 54)
You have specified a file that cannot be found or is not an image.
Specify a file name that is on the MATLAB path, or use a full or relative path.
Error in main/createComponents (line 1268)
app.PlotDataButton.Icon = 'ic_graphic_eq_48px.png';
Error in main (line 2111)
createComponents(app)
Ohh, sorry I forgot to attach the icons. But they are embeded in the directory of the main.mlapp file. Look, here's the application when I run it
When I press "Plot Data" Button, I hear the sound of error messages but I can't see 'em and nothing happen.
In short, the app doesn't feel the MATLAB environment which provides the core functions for the app's back-end code structure. But I can move around the GUI easily without any issues.
Do you include the icons as additional files in your standalone application?
I encountered a new error when I try to plot the 4th antenna option (Dolph-Tshebysceff Arrays). It occurs in the following function:
function [AF, z] = dolph(app, d, N, alpha, R)
Towards the end of the function, it tries to use a function or varilabe Tsheb. However, this does not appear to exist either in your app, or as a function I can find in MATLAB.
Undefined function 'Tsheb' for input arguments of type 'sym'.
Error in main/dolph (line 375)
AF0 = Tsheb(m,z1);
Error in main/PlotDataButton_4Pushed (line 750)
[AF,Z] = dolph(app,d,N,alpha,R);
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 335)
Error while evaluating Button PrivateButtonPushedFcn.
All aditional files are packaged to standalone app. As you can see in the figure above that the icons appear normally. Take a look
Thanks, Cris. So, I can't use sym function in my app and I have to find another solution?
That is correct. It appears you cannot include any functions from the Symbolic Toolbox in a standalone application.

Sign in to comment.

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!