Enumerated values in StateFlow chart
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello,
However, when I want to start the simulation, the SymbolWizard popup shows up that tells me that "RED" and "GREEN" are not defined and it wants me to add those signals. This step is not mentioned in the tutorial so I am not quite sure what I am supposed to do. I tried to add them as 'Data' with 'Parameters' Scope but then I cannot execute the simulation either:
Invalid setting in 'Chart' for parameter 'GREEN'
Error evaluating Stateflow parameter data 'GREEN' in its parent workspace.
Undefined function or variable 'GREEN'.
What am I doing wrong? What am I supposed to do with those actual state signals?
I am using Matlab R2014a with StateFlow 8.3
댓글 수: 0
채택된 답변
Orion
2014년 11월 27일
Hi,
Did you check that the data is defined in the explorer and that your chart is configured in C language ?
댓글 수: 0
추가 답변 (2개)
Joel
2014년 11월 27일
댓글 수: 1
Orion
2014년 11월 27일
You can change the action language since R2012b. Before, there was only C language.
Now, you can choose.
Note : you can still do the tutorial using Matlab language.
instead of
color = RED;
You just need to use a valid Matlab syntax :
color = TrafficColors.RED;
Arunkumar Muthukumaran
2015년 5월 12일
Hi, If I change the action language to C and just use the Enumeration Value, will it affect the generated code+?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!