Main Content

getFunctionArgument

Get function argument on function element

Since R2022a

    Description

    arg = getFunctionArgument(functionElem,argName) gets the function argument argName specified by a function prototype from a function defined by the function element functionElem.

    example

    Examples

    collapse all

    Create a new model.

    model = systemcomposer.createModel("archModel","SoftwareArchitecture");
    systemcomposer.openModel("archModel");

    Create a service interface.

    interface = addServiceInterface(model.InterfaceDictionary,"newServiceInterface");

    Create a function element.

    element = addElement(interface,"newFunctionElement");

    Set a function prototype to add function arguments.

    setFunctionPrototype(element,"y=f0(u)")

    Get a function argument.

    argument = getFunctionArgument(element,"y")
    argument = 
    
      FunctionArgument with properties:
    
          Interface: [1×1 systemcomposer.interface.ServiceInterface]
            Element: [1×1 systemcomposer.interface.FunctionElement]
               Name: 'y'
               Type: [1×1 systemcomposer.ValueType]
         Dimensions: '1'
        Description: ''
               UUID: '018b4e55-fa8f-4250-ac2b-df72bf620feb'
        ExternalUID: ''

    Input Arguments

    collapse all

    Function element, specified as a systemcomposer.interface.FunctionElement object.

    Argument name, specified as a character vector or string.

    Example: "y"

    Data Types: char | string

    Output Arguments

    collapse all

    Function argument, returned as a systemcomposer.interface.FunctionArgument object.

    More About

    collapse all

    Version History

    Introduced in R2022a

    See Also

    Functions

    Objects

    Blocks

    Tools