hasPrivateData

Determine whether operating point data contains private data elements

Syntax

hasPrivateData(op)

Description

example

hasPrivateData(op) returns true (1) if the operating point data tree contains elements corresponding to the Simscape™ language file members with the attribute ExternalAccess = none. Returns false (0) if the operating point does not contain private data.

Simscape language members with the attribute ExternalAccess = none are not observable by definition. Therefore, you cannot see them in the operating point data, but their inclusion helps restore the simulation state of the model during initialization.

When you log simulation data in the Simulation Data Inspector, the simulation log does not contain private Simscape language data. Therefore, if you extract an operating point from data logged using the Simulation Data Inspector, private data is not included. For all other methods of creating an operating point, whether from a model or from simulation data logged to memory or disk, private data is included by default.

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.

Introduced in R2018a