Stateflow, Determine Initial State
Ältere Kommentare anzeigen
I'm using the stateflow toolbox to track and control the states of an external physical unit. I'm reading a feedback signal from the unit telling me which state it's in, and sending the correct command signal (depending on current state) to bring it to the next desired state. During startup of the system, the unit could be in any state. Basically, the initial state is unknown (must read feedback signal to determine it) since I'm not controlling it. What’s the best way to configure this in the Stateflow chart? Current solution is to have a dedicated "dummy" initial state, which (depending on value of feedback signal) transitions directly to the correct actual starting state of the unit. This clutters the chart a bit, and there’s probably a more elegant way. I could probably use transition tables, but can these be combined for example, so I use a chart like now, but a table just to get the starting state right?
Akzeptierte Antwort
Weitere Antworten (1)
Fangjun Jiang
am 24 Sep. 2020
0 Stimmen
Use the default transition to pick any state as your initial state.
1 Kommentar
André Hvatum
am 24 Sep. 2020
Kategorien
Mehr zu Stateflow finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
