How to Increment a constant value every time when I run the simulink ?

조회 수: 15 (최근 30일)
kintali narendra
kintali narendra 2019년 5월 23일
댓글: kintali narendra 2019년 5월 24일
I want to keep a track of how many times my simulink model is run ? without using persistant variable and I also want to reset a variable when the simulink model is closed ? Please let me know if you have any ideas to implement this logic.

답변 (1개)

Toshinobu Shintai
Toshinobu Shintai 2019년 5월 24일
Generally speaking, it's impossible that you record statical value without using persistent variables.
If you can use Base Workspace variables, you can utilize Model Callbacks.
Example:
StartFcn : count up the counter.
CloseFcn : reset the counter to zero.

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by