Matlab Compiler And Simulink

Hi, I am trying to use matlab compiler to create a standalone application out of my GUI. Unfortunately in the GUI I must use 'sim' and 'simset' to call some simulink model. Does anyone have an idea how to work this out?
Thanks a lot! Jerry

Respuestas (6)

Guy Rouleau
Guy Rouleau el 22 de Abr. de 2020

3 votos

In R2020a, a new product Simulink Compiler has been released to address this exact use case. See an example here.
Seth Popinchalk
Seth Popinchalk el 24 de Jun. de 2011
Editada: John Kelly el 26 de Feb. de 2015

2 votos

The SIM and SIMSET command can not be called from the MATLAB Compiler (This is documented here). To build a standalone GUI that runs your simulation, you need to make the simulation standalone, then build the GUI to run that.
This can be accomplished by using Simulink Coder (or Real-Time Workshop in earlier released) to build a standalone executable. This executable can be called by the GUI to run. The outputs of the simulation executable can be loaded by the GUI and analyzed.
A similar question was asked to Technical Support, and they published a solution: How can I create a standalone executable of a MATLAB GUI which calls a Simulink model?

5 comentarios

Bardia
Bardia el 13 de Jul. de 2013
Hi, Is there an updated link to your last link. It says it can't be found, and google doesn't seem to be able to find it.
Josh Chambers
Josh Chambers el 14 de Jun. de 2016
That link now no longer works either. A quick googling reveals a new question with the same title. How can I create a deployable standalone executable from a MATLAB application that calls a Simulink model?
But no answer.
Kaixiang Wang
Kaixiang Wang el 7 de Jul. de 2018
Maybe this is the link people are talking about:
shalaka sitre
shalaka sitre el 27 de Mzo. de 2021
my simulink model onl completes 60% compilation and shows done.
how shopuld i complete it 100%?

Iniciar sesión para comentar.

Chirag Gupta
Chirag Gupta el 24 de Jun. de 2011

1 voto

The sim command is an unsupported command for the MATLAB Compiler and cannot be compiled.
The general strategy in such cases is to you use Simulink Coder to generated an executable out of the Simulink model which you can then control from the GUI.
Jinhuai Lin
Jinhuai Lin el 24 de Jun. de 2011

0 votos

Thank you, Chirag Gupta and Seth Popinchalk! But how can I change the simulation parameters such as solver and step size etc?
giovanni mazzuto
giovanni mazzuto el 29 de En. de 2015

0 votos

Hi. In this day, I'm having the same problem. I found this thread perfectly relevant to my problem. Obviously, there is another problem. All of the proposed links are not available. :( Could you help me, please.
warmest regards GM

1 comentario

Mark Tom
Mark Tom el 9 de Mayo de 2015
HI,i have a same problem ,are you solve it ? if you've solved it ,would you like to help me ???my email :aiguozheland@163.com,thank you very much

Iniciar sesión para comentar.

igdbak
igdbak el 12 de Feb. de 2018

0 votos

Is it possible to call Simulink.saveVars function? In case it is not, how could I call this function from a standalone application?

Categorías

Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.

Preguntada:

el 24 de Jun. de 2011

Comentada:

el 27 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by