フィルターのクリア

DNN training online integrating Simulink in Pyton

27 ビュー (過去 30 日間)
Lorenzo Grandi
Lorenzo Grandi 2024 年 9 月 9 日 12:23
回答済み: Sugandhi 2024 年 9 月 10 日 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?

回答 (1 件)

Sugandhi
Sugandhi 2024 年 9 月 10 日 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

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by