Simple Stateflow state machine - input port to change the defaul transition

7 ビュー (過去 30 日間)
Jack Daniels
Jack Daniels 2025 年 9 月 17 日
回答済み: Naresh 2025 年 10 月 12 日 15:57
I have a simple state flow diagram; the toggle switch is linked to the constant value - I can do toggling on the switch and able to switch the constant value. Further I would like to use the toggle-switch to control stateflow state machine. As of now I have always enabled state-machine and toggle switch cannot control stateflow chart .
How do I connect the default transition in stateflow chart with "start" input port which represents input from toggle switch. Please can you advice?

回答 (1 件)

Naresh
Naresh 2025 年 10 月 12 日 15:57
Hello Deniels,
I can say we can not add two default transition in the chart. But the solution to your problem is use "junction point" in the default transition which will work excatly as you required. here I am attaching the example which worked for me.
here the input "in" is the switch block simulated (see the other picture)
Thanks, Have a good day

カテゴリ

Help Center および File ExchangeStateflow についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by