DNN training online integrating Simulink in Pyton

조회 수: 1 (최근 30일)
Lorenzo Grandi
Lorenzo Grandi 2024년 9월 9일
답변: Sugandhi 2024년 9월 10일
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일
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 CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by