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.

removePrivateData

Remove private data elements from operating point

Syntax

opNew = removePrivateData(op)

Description

example

opNew = removePrivateData(op) returns a copy of the OperatingPoint object op, with hidden private data removed from the data tree hierarchy. Private data corresponds to the Simscape™ language file members with the attribute ExternalAccess = none.

Simscape language members with the attribute ExternalAccess = none are not observable by definition. Therefore, you cannot see them in the operating point data. Use hasPrivateData to determine whether an operating point data tree contains private data elements. Then use removePrivateData to remove the hidden elements, if necessary.

Examples

collapse all

In general, including private data in an operating point data tree helps with model initialization. However, if you are having trouble initializing a model from a saved operating point and wonder whether the issue is in the hidden private data, try using removePrivateData to remove the hidden elements.

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

Determine whether the operating point contains private data:

 hasPrivateData(op)
ans =

  logical

   1

Create a new operating point, op1, by removing private data from op:

 op1 = removePrivateData(op)
op1 = 

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

Verify that the new operating point does not contain private data:

 hasPrivateData(op1)
ans =

  logical

   0

Input Arguments

collapse all

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

Output Arguments

collapse all

New OperatingPoint object, which is a copy of the original OperatingPoint object, op, with private data elements 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 R2018a