Main Content

destroy

Destroy data interface and remove from interface dictionary

Since R2022b

    Description

    example

    destroy(dataInterfaceObj) destroys the data interface dataInterfaceObj and removes it from its parent interface dictionary.

    Examples

    collapse all

    This example shows how to delete a data interface and remove it from an interface dictionary.

    Create a Simulink.interface.Dictionary object by opening an existing interface dictionary.

    interfaceDictObj = Simulink.interface.dictionary.open('myInterfaceDict.sldd')
    interfaceDictObj = 
      Dictionary with properties:
    
        DictionaryFileName: 'myInterfaceDict.sldd'
                Interfaces: [1×1 Simulink.interface.dictionary.DataInterface]
                 DataTypes: [0×0 Simulink.interface.dictionary.DataType]

    This interface dictionary has one data interface definition.

    interfaceObj = interfaceDictObj.Interfaces
    interfaceObj = 
      DataInterface with properties:
    
               Name: 'interface1'
        Description: ''
           Elements: [1×2 Simulink.interface.dictionary.DataElement]
              Owner: [1×1 Simulink.interface.Dictionary]
    
    

    Use the destroy function to delete the interface and remove it from the interface dictionary.

    destroy(interfaceObj)
    interfaceDictObj
    
    interfaceDictObj = 
    
      Dictionary with properties:
    
        DictionaryFileName: 'myInterfaceDict.sldd'
                Interfaces: [0×0 Simulink.interface.dictionary.DataInterface]
                 DataTypes: [0×0 Simulink.interface.dictionary.DataType]

    The interface dictionary interfaceDictObj now has no interfaces.

    Input Arguments

    collapse all

    Data interface to delete, specified as a Simulink.interface.dictionary.DataInterface object.

    Version History

    Introduced in R2022b

    expand all