Main Content

remove

Remove element from operating point

Description

example

opNew= remove(op,opPath)returns a copy of theOperatingPointobjectop, with an element at the specified locationopPathremoved 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 anOperatingPointobject namedopusing theStartvalues from the model:

ssc_dcmotor 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

Select theLoad Torqueblock 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: OperatingPoints: ChildId Size ______________ ____ 'DC Motor' 1x1 'DC Voltage' 1x1 'ERef' 1x1 'MRRef Motor' 1x1 'MRRef Torque' 1x1 'Sensing' 1x1 'Step Input' 1x1

Operating pointopno longer has theLoad Torquechild.

Input Arguments

collapse all

Operating point in the workspace, specified as anOperatingPointobject.

Relative path in the operating point data tree, specified as a slash-delimited character vector or string scalar. Use therelativePathfunction 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

NewOperatingPointobject, which is a copy of the originalOperatingPointobject,op, with element at the location specified byopPathremoved from the data tree hierarchy. You can remove elements recursively, that is, the name of the newOperatingPointobject,opNew, can be the same as the name of the originalOperatingPointobject,op.

Version History

Introduced in R2017b