How to transfer output from simulink into m-file in real time

조회 수: 1 (최근 30일)
Joe Jones
Joe Jones 2022년 7월 8일
답변: Paul 2022년 7월 8일
I want to run the iterative algorithm in the m-file. There is a objective function in the m-file. The output of simulink needs to be used in the iterative algorithm, and it is used once every iteration.
e.g.
while k<N
alphak=object(x);%function
betak=m^alphak;
The "object" is a external function that needs to be called. In the function, I need to use output from simulink. Therefore, I want to consult that How to transfer output from simulink into m-file in real time?

답변 (1개)

Paul
Paul 2022년 7월 8일
Asusming the loop only needs the output of the simulation after the simulation completes ...
Use the sim command.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by