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

1 回表示 (過去 30 日間)
Gianmarco Morelli
Gianmarco Morelli 2020 年 10 月 24 日
回答済み: Fangjun Jiang 2020 年 10 月 26 日
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 Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by