This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

relativePath

Get path to node associated with block or subsystem

Syntax

opPath = relativePath(op,block)

Description

example

opPath = relativePath(op,block) returns a path from the root node of the operating point data tree op to the node associated with a given block or subsystem, block. The root node is specified by the Identifier property of the OperatingPoint object.

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:

ssc_dcmotor
op = simscape.op.create(gcs, 'Start')
op = 

  OperatingPoint with children:
  -----------------------------
   DC Motor
   DC Voltage
   ERef
   Load Torque
   MRRef Motor
   MRRef Torque
   Sensing
  -----------------------------

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'

When you determine relative path for a block, the operating point does not need to contain a node corresponding to that block. You can obtain operating point data for a block elsewhere, and then use the relativePath function to determine the correct location for inserting this data in the operating point for the current model.

Open the Permanent Magnet DC Motor example model:

ssc_dcmotor

Create an empty OperatingPoint object named op:

op = simscape.op.OperatingPoint
op = 

  OperatingPoint with no children.

Set the Identifier property of the OperatingPoint object to match the name of the model:

op.Identifier = 'ssc_dcmotor';

In the model, 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'

Input Arguments

collapse all

Operating point in the workspace, specified as an OperatingPoint object. The Identifier property of the OperatingPoint object must match the name of the model.

Block or subsystem name or identifier, specified as a handle, full path to a block or subsystem in the model, or a valid Simulink identifier (SID).

Data Types: double | char | string

Output Arguments

collapse all

Path to the node corresponding to the specified block, returned as a character vector, relative to the root node of the operating point data tree. The root node is specified by the Identifier property of the OperatingPoint object.

Introduced in R2017b