Simulink model "running" from stand-alone "app designer" app
27 次查看(过去 30 天)
显示 更早的评论
I am developing an app with app designer. The app employs Simulink models. I want to use the app through the standalone Desktop App.
The app runs/works correctly in the Matlab environment. However, I use the MATLAB compiler to create the app, then I execute the app and the app fails when the simulink code is executed.
simOut=sim('MODEL.slx','StopTime','TimeEnd','FixedStep','1','StartTime','0');
How can I run a Simulink model with a standalone desktop app?
Thank you in advance
2 个评论
Birdman
2020-3-31
What do you do in your Simulink model? Don't you have a chance to recreate it in a script?
采纳的回答
Kojiro Saito
2020-4-1
Yes, sim command does not work in MATLAB Runtime as of R2019b, so applications which use Simulink models cannot directly compile with MATLAB Compiler.
From R2020a, Simulink Compiler has released. With this toolbox as well as MATLAB Compiler, sim command can be compiled as a standalone application.
For limitation of Simulink Compiler, here is a list of toolboxes, functions and Simulink blocks which MATLAB Compiler / Simulink Compiler support.
5 个评论
Ro Os
2021-3-9
Dear @ @Kojiro Saito
Thank you for your response.
I have tried to emplement the example you mentioned on my code but still i have same problem.
I am using simout as the following:
simout = sim('BatteryRCDvF_10Hz_NMC','StartTime',num2str(app.StartTimeSecEditField.Value), 'StopTime', num2str(app.EndTimeSecEditField.Value) ,'FixedStep', num2str(app.StepTimeEditField.Value));
and then I plot it as the following:
plot(app.UIAxes, simout.SineWaveValue.Time, simout.SineWaveValue.Data);
(This is only a part of my code).
Knowing than i am using To Workspace to link between my App and Simulink Model.
Any help please?
Thank you in advance.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!