Main Content

createOwnedType

Create owned value type on data element or function argument

Since R2021b

    Description

    ownedType = createOwnedType(dataElement) creates an owned value type on a data element or function argument. An owned interface is an interface that is local to a specific port and not shared in a data dictionary or the model dictionary.

    example

    ownedType = createOwnedType(dataElement,Name=Value) creates an owned value type on a data element or function argument with additional options.

    Examples

    collapse all

    model = systemcomposer.createModel("archModel");
     
    port = model.Architecture.addPort("inPort","in");
    interface = port.createInterface("DataInterface");
    element = interface.addElement("newElement");
    subInterface = element.createOwnedType
    subInterface = 
    
      ValueType with properties:
    
               Name: ''
           DataType: 'double'
         Dimensions: '1'
              Units: ''
         Complexity: 'real'
            Minimum: '[]'
            Maximum: '[]'
        Description: ''
              Owner: [1×1 systemcomposer.interface.DataElement]
              Model: [1×1 systemcomposer.arch.Model]
               UUID: 'd184ab90-2be9-4acc-9d94-ed62d0cf2827'
        ExternalUID: ''
    

    Select the architecture port inPort on the architecture model and open the Property Inspector from the Modeling menu. Under Open in Interface Editor, select the edit link. In the Interface Editor, enter the Port Interface View. Observe the new data element newElement under the port inPort.

    Input Arguments

    collapse all

    Data element or function argument, specified as a systemcomposer.interface.DataElement or systemcomposer.interface.FunctionArgument object.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

    Example: createOwnedType(dataElement,DataType="double",Dimensions="2",Units="m/s",Complexity="complex",Minimum="0",Maximum="100",Description="Maintain altitude")

    Data type, specified as a character vector or string for a valid MATLAB® data type. The default value is double.

    Example: createOwnedType(dataElement,DataType="double")

    Data Types: char | string

    Dimensions of value type, specified as a character vector or string. The default value is 1.

    Example: createOwnedType(dataElement,Dimensions="2")

    Data Types: char | string

    Units of value type, specified as a character vector or string.

    Example: createOwnedType(dataElement,Units="m/s")

    Data Types: char | string

    Complexity of value type, specified as a character vector or string. The default value is real. Other possible values are complex and auto.

    Example: createOwnedType(dataElement,Complexity="complex")

    Data Types: char | string

    Minimum of value type, specified as a character vector or string.

    Example: createOwnedType(dataElement,Minimum="0")

    Data Types: char | string

    Maximum of value type, specified as a character vector or string.

    Example: createOwnedType(dataElement,Maximum="100")

    Data Types: char | string

    Description of value type, specified as a character vector or string.

    Example: createOwnedType(dataElement,Description="Maintain altitude")

    Data Types: char | string

    Output Arguments

    collapse all

    Owned value type, returned as a systemcomposer.ValueType object.

    More About

    collapse all

    Version History

    Introduced in R2021b

    See Also

    Functions

    Objects

    Blocks

    Tools