0

I have a Stateflow with state that handles the following pseudo code:

if input1==1 then
  new_state=state2;
else if input==2 then
  new_state=state3;
else
  new_state=error_state;
end if;

How to model the else in Stateflow? Currently I'm using [~(input==1 || input==2)], but when I have 10 transitions it becomes very nasty.

Dan
  • 45,079
  • 17
  • 88
  • 157
judoka_acl
  • 375
  • 2
  • 22

1 Answers1

2

You want the following type of construct. From state_one the decision about where to move next is made successively at each junction.

enter image description here

Phil Goddard
  • 10,571
  • 1
  • 16
  • 28