How to save the time of the simulink simulation on matlab?

1 次查看(过去 30 天)
Hello,
I need to create an "if" block on simulink, the block must be triggered when the simulation time is =0. My idea was to save the simulation time of simulink on a matlab variable and then to use it on simulink in a constant block.
Someone knows how to do that?
  1 个评论
Mathieu NOE
Mathieu NOE 2020-10-26
hello
I have some difficulty to understand what your intention is
what is the reason to trigger (once ?) at t= 0 ?
or do you want to save a "hit" time when the trigger condition occurs ?

请先登录,再进行评论。

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2020-10-26
Use the Clock block in your Simulink model. It outputs the simulation time. Do whatever you want.

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by