Main Content

getElement

Get object for element

Description

element = getElement(interface,name) gets the object for the element with name name in the interface specified by interface.

example

Examples

collapse all

Add a data interface newInterface to the interface dictionary of the model. Add a data element newElement with data type double. Then, get the object for the data element.

arch = systemcomposer.createModel("newModel");
systemcomposer.openModel("newModel");
interface = addInterface(arch.InterfaceDictionary,"newInterface");
addElement(interface,"newElement",DataType="double");
element = getElement(interface,"newElement")
element = 

  DataElement with properties:

      Interface: [1×1 systemcomposer.interface.DataInterface]
           Name: 'newElement'
           Type: [1×1 systemcomposer.ValueType]
           UUID: '2d267175-33c2-43a9-be41-a1be2774a3cf'
    ExternalUID: ''

Add a physical interface newInterface to the interface dictionary of the model. Add a physical element newElement with domain type electrical.electrical. Then, get the object for the physical element.

arch = systemcomposer.createModel("newModel");
systemcomposer.openModel("newModel");
interface = addPhysicalInterface(arch.InterfaceDictionary,"newInterface");
addElement(interface,"newElement",Type="electrical.electrical");
element = getElement(interface,"newElement")
element = 

  PhysicalElement with properties:

           Name: 'newElement'
           Type: [1×1 systemcomposer.interface.PhysicalDomain]
      Interface: [1×1 systemcomposer.interface.PhysicalInterface]
           UUID: '25b71628-e904-451a-96ff-f185c5ec60a4'
    ExternalUID: ''

Input Arguments

collapse all

Element name, specified as a character vector or string. An element name must be a valid MATLAB® variable name.

Data Types: char | string

Output Arguments

collapse all

More About

collapse all

Version History

Introduced in R2019a

See Also

Functions

Objects

Blocks

Tools