Integrate Simulink model simulation into matlab code

6 views (last 30 days)
Hey guys, how do I call a Simulink model in a matlab file so that I can evaluate the results of my simulation at specific points in time, and so that I can access and estimate the parameters of the simulink model. I tried a few commands but the model data needs to accessed like as if where from a separate Matlab function. Is there an approach to solve this problem?

Answers (1)

Raghava S N
Raghava S N on 28 Oct 2024 at 5:16
Hi,
From my understanding, you want to integrate Simulink model simulations with MATLAB and want to access parameters and model data during the simulation.
To run simulations and access simulation data and parameters programmatically, based on the requirement, you can use the “sim” function or the “Simulation” object as described in this documentation link - https://www.mathworks.com/help/simulink/ug/using-the-sim-command.html.
Note that the “Simulation” object was introduced in the MATLAB R2024a release, and you will need to upgrade to MATLAB R2024a or a later release to use it as there is no workaround for the same..
Hope this helps!

Categories

Find more on Modeling 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!