how to maintaing the last value of a variable to be used in the next loop cycle of a simulation?
조회 수: 2 (최근 30일)
이전 댓글 표시
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!