Run back simulink simulation

2 ビュー (過去 30 日間)
Hugo Teixeira
Hugo Teixeira 2023 年 2 月 8 日
回答済み: Balavignesh 2023 年 3 月 16 日
This may seem a wierd thing to do in simulink, and I dont even know if its possible, but essencially I need to be able to "run back" this simulink simulation if a certian condition is met. For example I have a vehicle going with 100% throttle, but I get to a curved path that the vehicle cant do, then I roll back a time step and reduce throttle, if I get to a point where I cant reduce throttle more I roll back another step. Im matlab I have achieved this by having a while loop where the iteration variable is reduced by one in this situation, allowing me to essencially resume the simulation with all the previous data but knowing that I cant go with that throttle.
Is this at all possible in simulink?
Thanks in advance, sorry if my question is confusing

回答 (1 件)

Balavignesh
Balavignesh 2023 年 3 月 16 日
Hi Hugo Teixeira,
As per my understanding, you would like to know to runback/ essentially resume the simulation with all previous data.
You can do it manually with the help of step back button in the simulation tab.
Alternatively, you can use the “To Workspace” block to periodically store the parameters to a workspace variable and if the necessary conditions are met, you can use the “From Workspace” block to restore the previous data and carryon with the simulation.
I hope this resolves your queries.

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by