I am trying to model a microwave in MATLAB's stateflow module. I have modeled states like on-off (microwave can be turned on/off). In 'on' state, I have sub-states like 'door open', 'door close' and 'cooking'. I have set conditions on transitions correctly. I was just wondering whether is it possible to provide cooking time as an input (from simulink) to this stateflow microwave model; exactly like we press the keypad on real microwave. This time will be taken as input and the stateflow chart will remain in 'cooking' until that time and the input time will decrement to zero
Modeling Microwave in Stateflow-Simulink - How to give cooking time as an input from the simulink?
611 Views Asked by ShriPat At
2
There are 2 best solutions below
0

You can find an example on how to pass an input from Simulink to state machines in Stateflow in the getting started videos here:
you can use a variable as
cook_time
in thestates/transitions
and while building the stateflow, it will detect it automatically, then you can specify it asInput from Simulink
in the GUI.