Main Content

simscape.probe.VariableConfiguration

Configuration of variable for probing

Since R2024b

Description

simscape.probe.VariableConfiguration is a configuration for probing a variable. Each VariableConfiguration object consists of a unit, port label, and probing status.

simscape.probe.VariableConfiguration returns a VariableConfiguration object that contains the default properties. You can configure these settings for probing a block variable. The VariableConfiguration object is stored as a value in a simscape.probe.VariableTable object.

Creation

Description

varConfig = simscape.probe.VariableConfiguration creates a VariableConfiguration object with default properties. You can also create this object with default properties when you configure a block variable in a simscape.probe.VariableTable object. You can then modify the configuration by assigning values to the object properties.

example

varConfig = simscape.probe.VariableConfiguration("Unit","PortLabel","Probing") creates a VariableConfiguration object with the specified properties, Unit, PortLabel, and Probing. To omit specifying a value for Unit or PortLabel, enter an empty string, "".

example

Properties

expand all

Physical unit expression, specified as a character vector, nonmissing string scalar, or a scalar simscape.Unit object. The string or character vector expression can consist of valid physical unit names, numbers, math operators, such as +, -, *, /, and ^, and parentheses to specify the order of operations. Physical unit of 1 indicates a unitless simscape.Value object.

Use this property to specify what unit the Probe block uses to output the block variable. The unit you specify must be commensurate with the default unit for the variable.

By default, the output unit matches the unit of the variable selected for probing. Use this property to specify a different unit.

Example: 'mm/s^2'

Name of the Probe block output port associated with the variable, specified as a character vector or string scalar.

By default, the Probe output port label matches the name of the variable selected for probing. Use this property to specify a different port label for the block.

Example: 'Torque'

Whether the data for a given variable is enabled for probing, specified as "off" or "on".

Examples

collapse all

This example shows how to create and modify variable configurations for probing.

Create an empty variable configuration to store the probing settings.

vc = simscape.probe.VariableConfiguration
vc = 

  VariableConfiguration with properties:

         Unit: ""
    PortLabel: <missing>
      Probing: off 

Modify the probing status.

vc.Probing = "on"
vc = 

  VariableConfiguration with properties:

         Unit: ""
    PortLabel: <missing>
      Probing: on 

Alternative ways of assigning the on status are true and 1. Alternative ways of assigning the off status are false and 0. For example:

vc.Probing = false
vc = 

  VariableConfiguration with properties:

         Unit: ""
    PortLabel: <missing>
      Probing: off 

Change the output unit.

vc.Unit = 'mm/s^2'
vc = 

  VariableConfiguration with properties:

         Unit: mm/s^2
    PortLabel: <missing>
      Probing: off 

Create another variable configuration, for probing a voltage variable.

VoltageConfig = simscape.probe.VariableConfiguration("mV","Voltage","on")
VoltageConfig = 

  VariableConfiguration with properties:

         Unit: mV
    PortLabel: "Voltage"
      Probing: on 

This example shows how to configure a variable for probing and add it to a variable table.

Create a VariableTable object and save it as a workspace variable.

table1 = simscape.probe.VariableTable
table1 = 

  VariableTable with unset variable(s)

Create a variable configuration for probing a voltage variable.

VoltageConfig = simscape.probe.VariableConfiguration("mV","Voltage","on")
VoltageConfig = 

  VariableConfiguration with properties:

         Unit: mV
    PortLabel: "Voltage"
      Probing: on 

Add this variable configuration to the VariableTable object, assigning it to the variable v.

table1 = insert(table1,"v",VoltageConfig)
table1 = 

  VariableTable with 1 variable(s):

             Unit     PortLabel    Probing
            ______    _________    _______

  
     v ⟼   {[mV]}    "Voltage"     true

Version History

Introduced in R2024b