stateflow 변수 초기화 방법
显示 更早的评论

stateflow에서 위와 같이 모델링 할경우 아래와 같이 a 초기값을 선언해달라고 하는데.
c언어에서 처럼 static a=0 과 같이 local 변수지만 초기화만 할수 있는 방법이 없을까요?
state에서는 en : a=0으로 할수는 있을거 같은데
많이 사용하는 방법에 대해 문의 드립니다.
The data a was read before being written to. This error will stop the simulation. Transition in Chart 'untitled/Chart': [a < 9]
3 个评论
Walter Roberson
2024-10-31
It looks like you are trying to read a in the condition [a < 9] before a has been assigned a value.
영진
2024-10-31
Walter Roberson
2024-10-31
According to https://www.mathworks.com/matlabcentral/answers/838503-persistent-data-in-stateflow#answer_708430
Variables you define as 'local' or as 'output' in the chart are persistent over chart executions.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


