Filter löschen
Filter löschen

How to run embedded Matlab function in Simulink periodically

1 Ansicht (letzte 30 Tage)
Baris Ciftci
Baris Ciftci am 7 Feb. 2018
Beantwortet: M am 7 Feb. 2018
I implemented a function inside Embedded Matlab function block in Simulink. I do not want the block to run in each consecutive simulation time step, but I want to run it periodically, let's say in each 1s. How can I do that?

Akzeptierte Antwort

M
M am 7 Feb. 2018
You can access the simulation time in your m function using :
get_param('YourModel','SimulationTime')
or you can use the clock block to execute your action every second.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by