メインコンテンツ

createFunctionGroup

Create function group in architecture of software component

Since R2026a

    Description

    functionGroupObj = createFunctionGroup(arch,functionGroupName,functions) creates a function group with name specified as functionGroupName, containing functions specified in functions.

    example

    Examples

    collapse all

    Create a model named mySoftwareArchitecture and get the root architecture.

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

    Create a software component and three functions.

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

    Set the period of three functions.

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

    Create a function group named newFunctionGroup and view component functions of the newly created group.

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

    Input Arguments

    collapse all

    Software architecture, specified as a systemcomposer.arch.Architecture object.

    Name of function group, specified as a character vector or string.

    Component functions to create a function group with, specified as an array of systemcomposer.arch.Function objects.

    Output Arguments

    collapse all

    Function group, specified as a systemcomposer.arch.Function object.

    More About

    collapse all

    Version History

    Introduced in R2026a