- Local data (local signals/variables) are stored within the chart and maintain their values across simulation time steps (task cycles). Their values persist unless explicitly changed by chart logic.
- Output signals are written to during chart execution and then passed to the Simulink environment. After each time step, Simulink resets output signals according to their initial values or the requirements of connected blocks. As a result, output signal values do not persist across time steps unless the chart explicitly assigns them a value at each step.
Why do my Stateflow ouput signal values not persist when set to a value upon entry of a state chart?
27 views (last 30 days)
Show older comments
In these action statements inside a stateflow chart, the local signal values persist across task cycles, but output signal values do not, even though they are only modified in the entry statement, and only in this chart:
en:
IterationSt++; %local signal
IterationSeq++; %local signal
Array2[idx] = CONST_SomeValue; % output signal
counter = 0; % local signal
BooleanOutp = true; %ouput signal
du:
counter++;
0 Comments
Answers (1)
Nidhi
on 17 Oct 2025 at 12:39
Hi Anthony,
I understand that in your Stateflow chart the local signals in a Stateflow chart retain their values across simulation steps, while output signals do not.
In Stateflow:
You can find more information in the following documentation link: https://www.mathworks.com/help/stateflow/ug/typing-stateflow-data.html
I hope this helps!
0 Comments
See Also
Categories
Find more on Decision Logic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!