How can I export my app that was created in app designer which uses simulink model to an executable format?

30 views (last 30 days)
Dear whom it may concern,
I am trying to convert the app that I have created into an executable format where users will install the software on their computers and run it without having matlab / simulink on their computer. My app uses a simulink model, I am saving the results of the simulation results into MATLAB workspace by using 'to workspace' simulink block and then parsing the data back to the app designer in a callback function. By using application compiler, I have compiled my app into executable format. However, in the exe the simulation does not run. I am aware the problem that causes this issue is that I use sim() command in the app designer, since I have compiled the executable by using MATLAB compiler sim() command is not supported. So, I tried using mcc command and followed the steps in 'Deploy an App Designer Simulation with Simulink Compiler' example and then tried to integrate the output from mcc command into 'files required for your application to run' section in the application compiler. It did not solve the issue. It should be noted that I did not use Simulink.SimulationInput Object in the callback function where the simulation is invoked. As I do not use tunable input parameters in my model. Could you please help me with the issue? I have attached screenshots which may be useful in this matter. Thank you in advance.
Kind regards,
Arda
The following figure shows that app designer is compiled by using simulink compiler via mcc command.
The following code is a part of code in the callback function in the app designer which causes problems when compiled.

Answers (1)

Mark McBroom
Mark McBroom on 19 Dec 2021
  1 Comment
Arda Denizer
Arda Denizer on 23 Dec 2021
Thank you for your reply Mark. After I run mcc command with my app, 2 exe files got created. One is for the simulink model and the other one is for the app itself. When I run the app executable that had created after I ran mcc command, it opens with a command terminal. However, I got an error "Error using Simulink.standalone_sim too many input arguments" in my executable version of my app when I invoke the callback function with uses sim() command. It should be noted that when I run the same callback in MATLAB in app designer (not exe) I do not get this error and it works as expected. What do you think that causes this problem? Looking forward to hear from you. Thank you in advance. You can see the error log in the following figure:

Sign in to comment.

Categories

Find more on Deploy Standalone Applications in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!