DNN training online integrating Simulink in Pyton

1 vue (au cours des 30 derniers jours)
Lorenzo Grandi
Lorenzo Grandi le 9 Sep 2024
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?

Réponses (1)

Sugandhi
Sugandhi le 10 Sep 2024
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

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by