Commenting out a Stateflow® object excludes it from simulation. To comment out a Stateflow object, right-click the object and select Comment Out. Use commenting to:
Debug a chart by making minor changes between simulation runs.
Test and verify the effects of objects on simulation results.
Create incremental changes for rapid, iterative design.
A commented object is not visible to the rest of the chart and the model. Commented objects in a chart are excluded from:
Active state output
References to commented functions or states result in compile-time errors.
When you explicitly comment out a Stateflow object with Comment Out, the object appears gray
with a badge . The software implicitly comments out some associated
objects. Implicitly commented objects also appear gray, but do not have a badge. For
example, if you explicitly comment out a state or junction, all incoming and outgoing
transitions are implicitly commented out. In this image of
steady_state is explicitly commented. The transitions in and out of
steady_state are implicitly commented.
|Explicitly Commented Stateflow Object||Implicit Results|
|States||All incoming and outgoing transitions, and child objects are implicitly commented out.|
|Junctions||All connected transitions are implicitly commented out.|
|Functions||The software cannot invoke a commented function from any chart or model.|
|Data||You cannot explicitly comment out data. If you comment out the parent object, then the software cannot reference the data.|
|Events||You cannot explicitly comment out events. If you comment out the parent object, then the software cannot reference the event.|
To uncomment an object, right-click the commented object and select Uncomment. All implicitly commented objects are restored as well. Implicitly commented objects cannot be uncommented directly.
Add a note to the commented object by clicking the badge . Point to a badge to see the associated comments. You cannot add notes to implicitly commented objects.
When you comment out an atomic subchart, the objects inside the chart do not appear implicitly commented. However, a commenting badge is displayed in the lower-left corner of the chart.