Main Content

setFunctionPrototype

Set prototype for function element

Since R2022a

    Description

    setFunctionPrototype(functionElem,prototype) sets the prototype prototype for a function represented by the function element object functionElem. Use prototypes to add, remove, and rename the arguments of a function element.

    example

    Examples

    collapse all

    Create a new model.

    model = systemcomposer.createModel("archModel","SoftwareArchitecture",true)

    Create a service interface.

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

    Create a function element.

    element = addElement(interface,"f0")

    Set the function prototype.

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

    Input Arguments

    collapse all

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

    Prototype, specified as a character vector or string in the form [y1,y2]=f0(u1,u2) where y1 and y2 are output arguments, u1 and u2 are input arguments, and f0 is the name of the functionElem object.

    Example: "y=f0(u1,u2)"

    Data Types: char | string

    More About

    collapse all

    Version History

    Introduced in R2022a

    See Also

    Functions

    Objects

    Blocks

    Tools