Setting Events in Matlab/Simulink Stateflow
- by GuiccoPiano
How can I set an event in a Simulink Stateflow (statechart) based on some value. What I mean is this.
I have a variable called "choice". This "choice" comes in as an input from a simulink block.The value of choice is between 1 and 4. So all I want to do is this:
if choice == 1 then trigger/set eventBlue
if choice == 2 then trigger/set eventRed
if choice == 3 then trigger/set eventWhite
if choice == 4 then trigger/set eventGreen
else trigger/set eventYellow
So how do i do that? what is the command?