主要内容

本页采用了机器翻译。点击此处可查看英文原文。

setFunctionPrototype

为函数元素设置原型

自 R2022a 起

    说明

    setFunctionPrototype(functionElem,prototype) 为函数元素对象 prototype 所代表的函数设置原型 functionElem。使用原型添加、删除和重命名函数元素的参量。

    示例

    示例

    全部折叠

    创建一个新模型。

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

    创建一个服务接口。

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

    创建一个函数元素。

    element = addElement(interface,"f0")

    设置函数原型。

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

    输入参数

    全部折叠

    函数元素,指定为 systemcomposer.interface.FunctionElement 对象。

    原型,指定为字符向量或字符串,形式为 [y1,y2]=f0(u1,u2),其中 y1y2 是输出参量,u1u2 是输入参量,f0 是 functionElem 对象的名称。

    示例: "y=f0(u1,u2)"

    数据类型: char | string

    详细信息

    全部折叠

    版本历史记录

    在 R2022a 中推出