Filter löschen
Filter löschen

Transition condition of Stateflow as Parameter

3 Ansichten (letzte 30 Tage)
Yuntao Zhang
Yuntao Zhang am 25 Jul. 2017
Bearbeitet: Sebastian Castro am 31 Jul. 2017
Hello Everyone. Is it possible to set a transition condition of Stateflow as something like "mask-parameter" or variables? Many thanks!
  2 Kommentare
Prasanth Sunkara
Prasanth Sunkara am 28 Jul. 2017
Can you please provide more information/code?
Yuntao Zhang
Yuntao Zhang am 31 Jul. 2017
Sorry that I don't have any codes. It's just a general question:
  • If I set parameter "a" as mask-parameter, I can change it without "look under mask" (for example set a=1 for one project, and a=2 for other)
  • Analog: Is it possible to set Stateflow Transition Condition as something similar to mask-parameter without go inside the Statechart? (for example set transistion condition "[b>0]" for one project, and "[b>2]" for other )
Thanks a lot for answers

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sebastian Castro
Sebastian Castro am 31 Jul. 2017
Bearbeitet: Sebastian Castro am 31 Jul. 2017
Yes, this approach does work.
If you create data in Stateflow, you can set its "Scope" to "Parameter".
When you update the model, Simulink will search for the variable in the following order:
  • Mask workspace
  • Model workspace
  • Base workspace
... so, if you create a mask around the Stateflow chart and define a parameter b in the mask, you're all set.
- Sebastian

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by