Main Content

remove

Remove element from operating point

Description

example

opNew = remove(op, opPath) returns a copy of the OperatingPoint object op, with an element at the specified location opPath removed from the data tree hierarchy. The element can be either a node or a target.

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

Select the Load Torque block and find the relative path to this block in the operating point data hierarchy:

 relPath = relativePath(op, gcb)
relPath =

    'Load Torque'

Now remove this element from the operating point:

 op = remove(op, relPath)
op = 

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

Operating point op no longer has the Load Torque child.

Input Arguments

collapse all

Operating point in the workspace, specified as an OperatingPoint object.

Relative path in the operating point data tree, specified as a slash-delimited character vector or string scalar. Use the relativePath function to determine the path to an element. 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 at the location specified by opPath removed from the data tree hierarchy. You can remove 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