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

1 vue (au cours des 30 derniers jours)
Joe Jones
Joe Jones le 8 Juil 2022
Réponse apportée : Paul le 8 Juil 2022
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?

Réponses (1)

Paul
Paul le 8 Juil 2022
Asusming the loop only needs the output of the simulation after the simulation completes ...
Use the sim command.

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by