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 comentarios

Mario Malic
Mario Malic el 31 de Dic. de 2020
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.
Taha Adel
Taha Adel el 31 de Dic. de 2020
Hi Mario, Thanks for your reply.
Can you tell me what exactly the Console Window is? and how to run it?

Iniciar sesión para comentar.

 Respuesta aceptada

Cris LaPierre
Cris LaPierre el 1 de En. de 2021
Editada: Cris LaPierre el 1 de En. de 2021
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)

Más respuestas (1)

Cris LaPierre
Cris LaPierre el 31 de Dic. de 2020

0 votos

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 comentarios

Taha Adel
Taha Adel el 31 de Dic. de 2020
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?
Cris LaPierre
Cris LaPierre el 31 de Dic. de 2020
Let's start with just the error messages. Can you you copy/paste the error messages you are getting?
Taha Adel
Taha Adel el 31 de Dic. de 2020
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?
Cris LaPierre
Cris LaPierre el 31 de Dic. de 2020
Does the app run correctly in MATLAB? When you run it from within add designer?
What is your MATLAB version and OS?
Taha Adel
Taha Adel el 31 de Dic. de 2020
The app works fine within MATLAB App Designer environment. MATLAB Version is 2018a and the OS is Windows 10.
Cris LaPierre
Cris LaPierre el 31 de Dic. de 2020
Editada: Cris LaPierre el 31 de Dic. de 2020
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.
Taha Adel
Taha Adel el 31 de Dic. de 2020
Windows 10 too.
Taha Adel
Taha Adel el 31 de Dic. de 2020
Here's the mlapp file
Cris LaPierre
Cris LaPierre el 31 de Dic. de 2020
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)
Taha Adel
Taha Adel el 31 de Dic. de 2020
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.
Taha Adel
Taha Adel el 31 de Dic. de 2020
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.
Cris LaPierre
Cris LaPierre el 31 de Dic. de 2020
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.
Taha Adel
Taha Adel el 31 de Dic. de 2020
All aditional files are packaged to standalone app. As you can see in the figure above that the icons appear normally. Take a look
Taha Adel
Taha Adel el 1 de En. de 2021
Thanks, Cris. So, I can't use sym function in my app and I have to find another solution?
Cris LaPierre
Cris LaPierre el 1 de En. de 2021
That is correct. It appears you cannot include any functions from the Symbolic Toolbox in a standalone application.

Iniciar sesión para comentar.

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 31 de Dic. de 2020

Comentada:

el 1 de En. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by