action with no side effect error

6 views (last 30 days)
Amish Rughoonundon
Amish Rughoonundon on 16 Mar 2016
Commented: Tania Izquierdo on 5 Dec 2016
Using stateflow with matlab R2015b.
In the first state that is connected to the "default transition" arrow, I tried to use a simple if statement as shown below
IDLE
entry:
if(a==0)
b=1;
else
b=0;
end
Compiler is indicating that this is an error as follows:
else
^^^^^
'IDLE' has an action with no side effect.
Occurred in chart 'testSubsystem/testChart', 'IDLE'. [2 similar]
Component: Stateflow | Category: Parse warning
Unresolved data 'else' in 'IDLE'.
Component: Stateflow | Category: General error
Unresolved data 'end' in 'IDLE'.
Component: Stateflow | Category: General error
Unresolved function 'if' in 'IDLE'.
Component: Stateflow | Category: General errorOpen
Parsing failed for machine: 'test'
Component: Simulink | Category: Model error
I'm seriously confused why a simple if statement is not compiling right. I have attached the statflow project to this question for good measure Any help would be highly appreciated, Amish

Answers (0)

Categories

Find more on Complex Logic in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!