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!


