Main Content

get

Access element of operating point data tree

Description

opElement = get(op, opPath) returns a copy of a node associated with the specified path opPath in the operating point op data tree. Depending on the path, the element can be either an OperatingPoint object or a Target object.

example

Examples

collapse all

Open the Permanent Magnet DC Motor example model and create an OperatingPoint object named op using the Start values from the model:

openExample('simscape/PermanentMagnetDCMotorExample')
op = simscape.op.create(gcs, 'Start')
op = 

  OperatingPoint with children:

  OperatingPoints:

   ChildId         Size
   ______________  ____

   'DC Motor'       1x1
   'DC Voltage'     1x1
   'ERef'           1x1
   'Load Torque'    1x1
   'MRRef Motor'    1x1
   'MRRef Torque'   1x1
   'Sensing'        1x1
   'Step Input'     1x1

Open the DC Motor subsystem, select the Inductor block, and find the relative path to this block in the operating point data hierarchy:

 relPath = relativePath(op, gcb)
relPath =

    'DC Motor/Rotor Inductance'

Copy the block data into a new operating point, opRI:

opRI = get(op, relPath)
opRI = 

  OperatingPoint with children:

  Targets:

   ChildId       Value  Unit  Priority
   _______  __________  ____  ________

   'i'      1.5000e-09  'A'     'None'
   'i_L'             0  'A'     'High'
   'v'          1.5000  'V'     'None'

  OperatingPoints:

   ChildId  Size
   _______  ____

   'n'       1x1
   'p'       1x1

Input Arguments

collapse all

Operating point in the workspace, specified as an OperatingPoint object, from which you are copying an element.

Location associated with the element to copy, specified as a slash-delimited character vector or string scalar. Define the location by the relative path through the data tree hierarchy of the operating point, op, starting below the root node. The root node is specified by the Identifier property of the OperatingPoint object. Separate the tree node names with slash symbols (/).

Example: 'DC Motor/Rotor Resistance'

Data Types: char | string

Output Arguments

collapse all

New OperatingPoint or Target object, which is a copy of the op element at the opPath location.

Version History

Introduced in R2017b