Is it possible to comment out the block in Simulink like it is possible in any programming languages ? I mean, using logic, I can disable the block. but its not the best solution all the time.
I would rather disable / comment out the part of the block in my Model to test individual modules in Simulink.
Simulink allows you to disable linked blocks in a model. Simulink ignores disabled links when simulating a model. To disable a link, select the link, choose Link options from the model window's Edit or context menu, then choose Disable link.
The Simulink compilation phase propagates signal and sample time attributes. It is equivalent to selecting the "Edit -> Update Diagram" (Ctrl-D) menu item from the Simulink menubar. Before every simulation and when the user requests it, Simulink performs an 'Update Diagram' (Ctrl-D) to ready the model for simulation.
Create Text AnnotationsDouble-click the canvas where you want to create the annotation and select Create Annotation from the menu. Click the annotation box on the Simulink Editor palette and then click the canvas. Drag the annotation box on the Simulink Editor palette to the canvas.
However you may right-click the name (or shift-left click) and press delete. It will hide the name of the block.
I just wanted to add that in Simulnk 2012b, it is now possible to explicitly comment out blocks. Simply right-click on the block and select the option "Comment Out".
When run, the model will act as if the commented out block is not there at all. This means that input/output signals to/from this block are essentially just left open. So for example, if you commented out a gain block, the input signal would not simply pass through to the output signal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With