Guy on Simulink

Simulink & Model-Based Design

Commenting out… in Stateflow!

I am so happy right now!

Since R2012b, it has been possible to comment out blocks in Simulink. As soon as this feature was released, it immediately became popular among all the users I know.

Soon after, in R2013b, the possibility to comment-through blocks with same numbers of inputs and outputs was introduced. Also very useful!

Today I just realized that in R2014b, it is also possible to comment out Stateflow objects.

Commenting Stateflow Objects in a Chart

Commenting out a Stateflow object is as easy as it should be. Select one or more objects and hit Ctrl+Shift+X

Commenting out States and Transitions in Stateflow

Adding text to the commented objects

One useful feature associated with commented Stateflow objects is the possibility to add notes, for example to explain why the object is commented. Click on the % sign on the bottom left corner of the object and a dialog will popup.

Adding a note to a commented Stateflow object

The text entered in this dialog will be displayed when you hover the mouse over the object.

Displaying a note to a commented Stateflow object

Now it's your turn

In my opinion, the ability to comment out Simulink blocks and Stateflow objects, has most significantly affected my model editing workflow in many years.

Have you also included the commenting in your workflows? Let us know by leaving a comment here.

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.