connections
Define connections for member component ports in composite component
Parent Section: component
Syntax
connections
connect(a, b);
end
Description
connections begins the structure section in a composite component
file; this section is terminated by an end keyword. It is executed
once during compilation. The structure section contains information on how the
constituent components’ ports are connected to one another and to the external inputs,
outputs, and nodes of the top-level component. All member components declared in the
components declaration block are available by their names in the
structure section.
The connections block contains a set of connect
constructs, which describe both the conserving connections (between
nodes) and the physical signal connections (between the
inputs and outputs). To refer to a node,
input, or output of a member component, use the syntax
comp_name.port_name, where comp_name is the
identifier assigned to the member component in the components
declaration block and port_name is the name of the node, input, or
output in the member component file.
The following syntax connects node a of the composite component to
node a of the member component c1, node
b of the member component c1 to node
a of the member component c2, and node
b of the member component c2 to node
b of the composite component.
connections
connect(a, c1.a);
connect(c1.b, c2.a);
connect(c2.b, b);
end
See the connect reference page for more information on the
connect construct syntax.
You can also use for loops to declare an array of member components
and specify the component connections. For more information, see Component Arrays.
Examples
Version History
Introduced in R2012b
