Enumerated values in StateFlow chart

12 ビュー (過去 30 日間)
Joel
Joel 2014 年 11 月 27 日
回答済み: Arunkumar Muthukumaran 2015 年 5 月 12 日
Hello,
I am precisely following this tutorial: Assign Enumerated Values in a chart
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

採用された回答

Orion
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 ?

その他の回答 (2 件)

Joel
Joel 2014 年 11 月 27 日
Thank you very much. I changed the langauage from 'MATLAB' to 'C' and now it works indeed. I think that this information should be added to the tutorial. Or is this some general setting that is usually used anyone?
  1 件のコメント
Orion
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
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+?

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by