Main Content

destroy

Delete data interface and remove it from Architectural Data section of Simulink data dictionary

Since R2023b

    Description

    example

    destroy(dataInterfaceObj) deletes the data interface dataInterfaceObj and removes it from the Architectural Data section of its parent data dictionary.

    Examples

    collapse all

    This example shows how to delete a data interface and remove it from the Architectural Data section of a Simulink® data dictionary.

    Create a Simulink.dictionary.ArchitecturalData object by opening an existing data dictionary.

    archDataObj = Simulink.dictionary.archdata.open("myInterfaceDict.sldd")
    archDataObj = 
    
      ArchitecturalData with properties:
    
        DictionaryFileName: 'myInterfaceDict.sldd'
                Interfaces: [1×1 Simulink.dictionary.archdata.DataInterface]
                 DataTypes: [0×0 Simulink.dictionary.archdata.DataType]
                 Constants: [0×0 Simulink.dictionary.archdata.Constant]

    The data dictionary has one data interface definition.

    interfaceObj = archDataObj.Interfaces
    interfaceObj = 
    
      DataInterface with properties:
    
               Name: 'DataInterface'
        Description: ''
           Elements: [0×0 Simulink.dictionary.archdata.DataElement]
              Owner: [1×1 Simulink.dictionary.ArchitecturalData]

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

    destroy(interfaceObj)
    archDataObj
    archDataObj = 
    
      ArchitecturalData with properties:
    
        DictionaryFileName: 'myInterfaceDict.sldd'
                Interfaces: [0×0 Simulink.dictionary.archdata.DataInterface]
                 DataTypes: [0×0 Simulink.dictionary.archdata.DataType]
                 Constants: [0×0 Simulink.dictionary.archdata.Constant]

    The data dictionary now has no interfaces.

    Input Arguments

    collapse all

    Data interface object, specified as a Simulink.dictionary.archdata.DataInterface object.

    Version History

    Introduced in R2023b