Matlab stateflow else transition

704 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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