主要内容

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

createFunctionGroup

在软件组件架构中创建函数组

自 R2026a 起

    说明

    functionGroupObj = createFunctionGroup(arch,functionGroupName,functions) 创建了一个名称为 functionGroupName 的函数组,其中包含 functions 中指定的函数。

    示例

    示例

    全部折叠

    创建名为 mySoftwareArchitecture 的模型,并获取根架构。

    model = systemcomposer.createModel("mySoftwareArchitecture","SoftwareArchitecture");
    rootArch = model.Architecture;

    创建一个软件组件和三个函数。

    newComp = rootArch.addComponent("Component1");
    newFunctions = newComp.Architecture.addFunction({'Function1','Function2','Function3'});
    rootArch

    确定这三个函数的周期。

    fun1 = newFunctions(1);
    fun1.Period = 0.05;
    fun2 = newFunctions(2);
    fun2.Period = 0.05;
    fun3 = newFunctions(3);
    fun3.Period = 0.2;

    创建一个名为 newFunctionGroup 的函数组,并查看该新创建的组的组件函数。

    functionGroup = rootArch.createFunctionGroup("newFunctionGroup", [fun1, fun2]);
    {functionGroup.ComponentFunctions.Name}

    输入参数

    全部折叠

    软件架构,指定为 systemcomposer.arch.Architecture 对象。

    函数组的名称,指定为字符向量或字符串。

    用于创建函数组的组件,指定为 systemcomposer.arch.Function 对象的数组。

    输出参量

    全部折叠

    函数组,指定为 systemcomposer.arch.Function 对象。

    详细信息

    全部折叠

    版本历史记录

    在 R2026a 中推出