Main Content

remove

Remove key from variable table object

Since R2024a

    Description

    newVariableTable = remove(variableTable,key) removes the key, key, from the variable table object, variableTable and returns the variable table object, newVariableTable.

    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. Remove the C.w key by entering:

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

    Input Arguments

    collapse all

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

    Block variable name to remove, specified as a character vector or string.

    Output Arguments

    collapse all

    Updated variable table, returned as a simscape.instrumentation.VariableTable object.

    Version History

    Introduced in R2024a