How I can run a simulink model from Python script?

192 views (last 30 days)
Hi, I'm trying to write a script in Python that generate number of inputs, and use them as inputs in a Simulink model. My doubt is how to run a Simulink model from Python (I'm working in windows). Could someone help me?
Thanks
  2 Comments
Meng Zhang
Meng Zhang on 1 Dec 2021
how to run the simulnk model just for one step by using MATLAB Engine API?

Sign in to comment.

Accepted Answer

Bo Li
Bo Li on 22 Sep 2016
You may consider MATLAB Engine API for Python:
For example:
>>>import matlab.engine
>>>eng = matlab.engine.start_matlab()
>>>eng.sim("vdp")
  5 Comments
Indhu Priyadharshini Govindasamy
I tried in python like you commented before .it is working completely fine but
i want to run the simulink model in C code and Engine Api
I could find any reference for that.Could you please help me?

Sign in to comment.

More Answers (1)

Meng Zhang
Meng Zhang on 1 Dec 2021
how to run the simulnk model just for one step by using MATLAB Engine API?

Community Treasure Hunt

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

Start Hunting!