Is it possible to calculate and hold a value constant during the Simulink calculation

Is it possible to calculate a value somewhere during a simulink simulation and use it from that point on as a constant in a calculation. I would use this in a IF action subsystem (or maybe While or For loop) where at a certain condition a value should be calculated and from that point on used in a calculation as a constant.

1 件のコメント

Jorge Ignacio Cisneros Saldana
Jorge Ignacio Cisneros Saldana 2021 年 3 月 12 日
編集済み: Jorge Ignacio Cisneros Saldana 2021 年 3 月 12 日
Do you have some example in block diagram. I am trying to calculate a value, during simulation then use this value as input during same simulation, but his value does nedd to be updated for the whole time, just for a portion of it.

サインインしてコメントする。

 採用された回答

Paul
Paul 2011 年 3 月 14 日

1 投票

Put the calculation inside a triggered subsystem and make the output of the system the desired calculated value. Trigger the subsystem when you want to calculate the value.

1 件のコメント

Do you have some example in block diagram. I am trying to calculate a value, during simulation then use this value as input during same simulation, but his value does nedd to be updated for the whole time, just for a portion of it.

サインインしてコメントする。

その他の回答 (1 件)

Stanko
Stanko 2011 年 3 月 15 日

0 投票

Tnx Paul,
it took me a while but it worked.

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by