stateflow 변수 초기화 방법
Show older comments

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 Comments
Walter Roberson
on 31 Oct 2024
It looks like you are trying to read a in the condition [a < 9] before a has been assigned a value.
영진
on 31 Oct 2024
Walter Roberson
on 31 Oct 2024
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.
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

