Access / call Simulink from Python

I want to simulate a system in Simulink and then access this simulation from a python program to submit its new conditions or input.

I know that there is a module that allows you to access the Matlab engine with Python, but this is a little different.

I would like to have a system simulated in Simulink and control some hardware using Python. Then, each say a quarter of a second or so, call Simulink, run the simulation using the current hardware conditions, get some result and repeat the process. Basically I am trying to play with a real-time simulator for hardware.

I am running Ubuntu 11.04

I know Python is perfect for this, but it is not. Any idea if this is possible? Or where can I start?

+4
source share
1 answer

There is an open source HTTP server and XML-RPC for Matlab Simulink called SimServer:

http://simulinksimserv.sourceforge.net/

An example Python script was provided (in a package) that shows how the XML-RPC interface can be used to receive and set data in the current Simulink model.

+3
source

Source: https://habr.com/ru/post/1382096/


All Articles