Main Content

destroy

Delete data element and remove from data interface

Since R2023b

    Description

    destroy(archDataObj) deletes the architectural data object specified by archDataObj and removes it from the parent object.

    example

    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

    Architectural Data object, specified as a Simulink.dictionary.ArchitecturalData object, or any object owned by Simulink.dictionary.ArchitecturalData.

    Version History

    Introduced in R2023b