components
Declare member components included in composite component
Parent Section: component
Syntax
components(ExternalAccess=observe) a = package_name.component_name; end
Description
components
begins a components declaration block,
which is terminated by an end
keyword. This block, used in composite
models only, contains declarations for member components included in the composite
component. A components
declaration block must have
its ExternalAccess
attribute value set to observe
(for more information on member attributes, see Attribute Lists).
Each member component is defined by assignment to an existing component file. See Declaring Member Components for more information.
The following syntax defines a member component, a
, by associating
it with a component file, component_name
.
package_name
is the full path to the component file, starting
with the top package directory. For more information on packaging your Simscape™ files, see Building Custom Block Libraries.
components(ExternalAccess=observe) a = package_name.component_name; end
After you declare all member components, specify how their ports are connected to one another, and to the external inputs, outputs, and nodes of the top-level component. See Specifying Component Connections for more information.
Once you declare a member component, you can use its parameters and variables in the equation section of the composite component file. If you want a parameter of the member component to be adjustable, associate it with the top-level parameter of the composite component. See Parameterizing Composite Components for more information.
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