how to maintaing the last value of a variable to be used in the next loop cycle of a simulation?
3 ビュー (過去 30 日間)
古いコメントを表示
Tony Castillo
2022 年 5 月 19 日
回答済み: Midhulesh Vellanki
2022 年 5 月 20 日
Dear all,
I just wondering how to extract/save the last value registered from a time-series, to furtherly use it in the following loop iteration as the initial value (for a specific variable). I think worth highlighting this is a model designed in Simulink and ran using scripts of MATLAB.
Thanks in advance !!
0 件のコメント
採用された回答
Midhulesh Vellanki
2022 年 5 月 20 日
For a timeseries variable you can access data using Data property.If your variable name is `var`, use `var.Data(end)` to access the last value of the timeseries.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!