This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Define component nodes, that is, conserving ports of block


nodes a = package_name.domain_name; end     


nodes begins a nodes declaration block, which is terminated by an end keyword. This block contains declarations for all the component nodes, which correspond to the conserving ports of a Simscape™ block generated from the component file. Each node is defined by assignment to an existing domain. See Declare Component Nodes for more information.

The following syntax defines a node, a, by associating it with a domain, domain_name. package_name is the full path to the domain, starting with the top package directory. For more information on packaging your Simscape files, see Building Custom Block Libraries.

    a = package_name.domain_name;

You can specify the port label and location, the way you want it to appear in the block diagram, as a comment:

    a = package_name.domain_name;  % label:location

where label is a string corresponding to the port name in the block diagram, location is one of the following strings: left, right, top, bottom.


The following example uses the syntax for the Simscape Foundation mechanical rotational domain:

    r = foundation.mechanical.rotational.rotational;

The name of the top-level package directory is +foundation. It contains a subpackage +mechanical, with a subpackage +rotational, which in turn contains the domain file rotational.ssc.

If you want to use your own customized rotational domain called rotational.ssc and located at the top level of your custom package directory +MechanicalElements, the syntax would be:

    r = MechanicalElements.rotational;

The following example declares an electrical node using the syntax for the Simscape Foundation electrical domain. In the block diagram, this port will be labelled + and will be located on the top side of the block icon.

    p = foundation.electrical.electrical; % +:top

Introduced in R2008b

Was this topic helpful?