Main Content

values

Return configuration for specified variable table object

Since R2024a

    Description

    vc = values(variableTable) that contains the variable configurations for the variable table, variableTable.

    example

    Examples

    collapse all

    1. Create a variable table and save it as a workspace variable by entering:

      table1 = simscape.instrumentation.VariableTable
      table1 = 
      
        VariableTable with unset variable(s)

    2. Suppose you have a Simscape block with the variables C.w and R.w. Add the variables to table1 by entering:

      table1 = insert(table1,"C.w",simscape.instrumentation.VariableConfiguration);
      table1 = insert(table1,"R.w",simscape.instrumentation.VariableConfiguration)
      table1 = 
      
        VariableTable (string ⟼ VariableConfiguration) with 2 variable(s):
      
                      Name       Unit    Logging
                    _________    ____    _______
      
          C.w ⟼    <missing>     ""      false 
          R.w ⟼    <missing>     ""      false 
      

    3. Provide names for the VariableConfiguration objects.

      table1("C.w").Name = "Port C Speed";
      table1("R.w").Name = "Port R Speed";
    4. Return the VariableConfiguration array.

      vc = values(table1)
      vc = 
      
        2×1 VariableConfiguration array with properties:
      
          Name
          Unit
          Logging
    5. Return the information for a single VariableConfiguration object in the array.

      vc(2,1)
      ans = 
      
        VariableConfiguration with properties:
      
             Name: "Port R Speed"
             Unit: ""
          Logging: off

    Input Arguments

    collapse all

    Variable table, specified as a simscape.instrumentation.VariableTable object.

    Output Arguments

    collapse all

    Variable configuration, returned as an array of simscape.instrumentation.VariableConfiguration objects.

    Version History

    Introduced in R2024a