Borrar filtros
Borrar filtros

DNN training online integrating Simulink in Pyton

27 visualizaciones (últimos 30 días)
Lorenzo Grandi
Lorenzo Grandi el 9 de Sept. de 2024 a las 12:23
Respondida: Sugandhi el 10 de Sept. de 2024 a las 11:17
I need to integrate a Simulink model in Python. Specifically, the goal is to pass some simulink signals to a tensorflow neural network defined in Python and put back the result of the processing to the Simulink model. I need to maintain the project in this way in order to open the possibility of online training of the network. Is this possible?

Respuestas (1)

Sugandhi
Sugandhi el 10 de Sept. de 2024 a las 11:17
Hi Lorenzo,
Yes, integrating a Simulink model with a TensorFlow neural network in Python is possible using MATLAB Engine API for Python and MATLAB Function Block in Simulink. Here are high level steps:
  1. Install MATLAB Engine API for Python.
  2. Create a MATLAB Function Block in Simulink: Use a MATLAB Function block to call a Python script. This block can be used to execute Python code from within Simulink. Python script will be called from the MATLAB Function block. Use the MATLAB Engine API to pass data between MATLAB and Python.
Go through the following MathWorks documentation to gain better understanding:
  1. Get Started with MATLAB Engine API for Python: https://www.mathworks.com/help/matlab/matlab_external/get-started-with-matlab-engine-for-python.html
  2. MATLAB Function Block: https://www.mathworks.com/help/simulink/slref/matlabfunction.html
  3. Call Python from MATLAB: https://www.mathworks.com/help/matlab/call-python-libraries.html

Categorías

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

Productos


Versión

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by