stateflow chart simulink reset function

6 ビュー (過去 30 日間)
massimiliano frasca
massimiliano frasca 2023 年 2 月 21 日
回答済み: Rasmita 2023 年 3 月 15 日
Hi everyone,
how you can see from the picture, the function "sim" starts working in the first block.
In the second block, the reference is costant.
In the third block I use again the function "sim". How can I restart this function? It keeps calculating even in the second block, I'd need a way to restart from the begginning or reset the function "sim" in the third block (as if called again for the first time)
thanks for the help
  2 件のコメント
Luca Ferro
Luca Ferro 2023 年 2 月 21 日
could you share the code of sim?
massimiliano frasca
massimiliano frasca 2023 年 2 月 21 日
thank for the help

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

回答 (1 件)

Rasmita
Rasmita 2023 年 3 月 15 日
Hi,
It is my understanding that, in your model, “sim” function starts working in the first state, and even keeps calculating in the second state. You want to know how the function “sim” can be restarted from the beginning or can be reset in the third state.
For this you can bind the “sim” function to first state and second state separately. Bind to a state means the “sim” function resides inside the state. By doing this, the function is enabled when the state is entered and disabled when the state is exited. Hence in the third block the “sim” function will be called as if it is the first time.
To know how to bind a Simulink function to a state refer to below documentation:
Hope this helps!
Regards,
Rasmita

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by