How to run embedded Matlab function in Simulink periodically

조회 수: 3 (최근 30일)
Baris Ciftci
Baris Ciftci 2018년 2월 7일
답변: M 2018년 2월 7일
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?

채택된 답변

M
M 2018년 2월 7일
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.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by