How to update a base workspace variable from GUI during Stateflow execution?

1 view (last 30 days)
VS is a base workspace variable (accessible from GUI.
c is a local variable.
Transition from state 2 to state 1 should happen when VS is < 40 continuously for certain time. So in the conditional loop VS is checked until the local variable reaches 120000. In the loop execution period, if VS exceeds 40 (VS > 40) then it has to terminate the loop and jump to the same state 2.
But the VS is not changing when the loop is being executed and the loop terminates only after c reaches 120000.
VS variable if changed from GUI, its value is not getting changed in base workspace- leading to the problem.
If the variable VS is replaced as c in the loop, it works fine as per condition.
Please clarify what is wrong with this model.
  1 Comment
Kaustubha Govind
Kaustubha Govind on 27 Jun 2014
So is the problem really that the value of VS is not getting updated in the base workspace, and not specific to the Stateflow chart? How are you updating the workspace value from the GUI? Also, how do you start the simulation - is it from a GUI callback? You may want to specify the SIM command that you use to start simulation.

Sign in to comment.

Answers (0)

Categories

Find more on Complex Logic in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!