Ports & Subsystems A subsystems is a collection of blocks grouped together to carry
out a particular task. They help to keep models organised and
easier to understand. The example subsystem on right takes two
inputs. It doubles the first input, quadruples the second input
and outputs the sum.
Creating a Subsystem
Drag in a Subsystem block from the Ports and Subsystems library
OR
Select the blocks that you want to put into a subsystems and right click then select
Create Subsystem from Selection in the menu that appears. You can have many nested subsystem (i.e. a subsystem in a subsystem).
Once you have a subsystem, you can open it by double clicking the block. This opens a new tab
showing the blocks of the subsystem. Exit the subsystem and return to the top page by:
Selecting the ‘Up to Parent’ arrow OR
Selecting the home tab, e.g. ‘MyModel’
Input and output ports are called In and Out. If you need
extra input/output ports, they can be found in the Ports and
Subsystems library or the relevant Source / Sink library.
Trigger, Reset and Enable Inputs to Subsystems You may need a part of your model to only occur when an appropriate signal
is applied, or for blocks to reset at certain time intervals. For this you place
an Enable, Trigger or Reset block inside the subsystem. These will create an
appropriate input port on the subsystem.
There is extensive documentation on the MathWorks website giving
comparisons of each of these subsystems. A summary is given below:
Enabled Subsystems: Subsystem only runs when signal is 1 through the enable input, a 0
will disable it. The block parameters of the output ports allow configuration to either hold
the current value or reset to a specified value when the subsystem is disabled.