MATLAB: Simulink (R2013a) gives error message of ‘Block diagram ‘modelname’ contains no blocks or all blocks are virtual’

simulink

I created a model with an Inport connected to an empty subsystem block. When I update the model, I get the following error message:
Block diagram 'modelname' contains no blocks or all blocks are virtual

Best Answer

This error occurs if there is no functional block (block from sources, sinks, operations, etc.) in the model. Subsystem block is merely a visual boundary for blocks.
To fix this, add an Outport block and connect the output of the subsystem to it. Alternatively, you can add any functional block to the model to suppress the error message.
Related Question