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.

move

Move element from one path to another

Syntax

opNew = move(op, oldPath, newPath)

Description

example

opNew = move(op, oldPath, newPath) returns a copy of the OperatingPoint object op, with an element at the specified location oldPath moved to the new location, specified by newPath. Use this function to update the operating point data after restructuring your model or renaming a block or subsystem.

Examples

collapse all

When you rename a block in your model, use the move function to update the operating point data.

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
  -----------------------------

Select the DC Voltage block and find the relative path to this block in the operating point data hierarchy:

 oldPath = relativePath(op, gcb)
oldPath =

    'DC Voltage'

Rename the DC Voltage block to 1.5V.

Select the block again and find the new relative path:

 newPath = relativePath(op, gcb)
newPath =

    '1.5V'

Update the operating point data hierarchy to reflect the new block name:

op = move(op, oldPath, newPath)
op = 

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

Operating point op now lists 1.5V as its child.

Input Arguments

collapse all

Original operating point in the workspace, specified as an OperatingPoint object.

Relative path to the original element in the operating point data tree, specified as a slash-delimited character vector or string scalar. The element can be a subsystem, block, or variable target.

Data Types: char | string

Relative path to the new element in the operating point data tree, specified as a slash-delimited character vector or string scalar. The element can be a subsystem, block, or variable target.

Data Types: char | string

Output Arguments

collapse all

New OperatingPoint object, which is a copy of the original OperatingPoint object, op, with element specified by oldPath moved to the new location, newPath. You can move elements recursively, that is, the name of the new OperatingPoint object, opNew, can be the same as the name of the original OperatingPoint object, op.

Introduced in R2017b