Integrate Simulink model simulation into matlab code

6 visualizaciones (últimos 30 días)
Jon Petersen
Jon Petersen el 5 de Sept. de 2016
Respondida: Raghava S N el 28 de Oct. de 2024 a las 5:16
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?

Respuestas (1)

Raghava S N
Raghava S N el 28 de Oct. de 2024 a las 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!

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by