主要内容

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

rebindTargetModel

更改目标模型

自 R2024a 起

    说明

    rebindTargetModel(allocSet,name) 会将目标模型链接到 name 指定的模型。如果新模型没有相同的结构,则不会保留分配。

    示例

    示例

    全部折叠

    创建两个新模型,每个模型有一个组件。

    mSource = systemcomposer.createModel("Source_Model_Allocation");
    systemcomposer.openModel("Source_Model_Allocation");
    sourceComp = addComponent(get(mSource,"Architecture"),"Source_Component");
    mTarget = systemcomposer.createModel("Target_Model_Allocation");
    systemcomposer.openModel("Target_Model_Allocation");
    targetComp = addComponent(get(mTarget,"Architecture"),"Target_Component");

    创建一个名为 MyNewAllocation 的分配集。

    allocSet = systemcomposer.allocation.createAllocationSet("MyNewAllocation",...
         "Source_Model_Allocation","Target_Model_Allocation");

    创建一个新模型。然后,在分配集中重新绑定目标模型。

    mTarget2 = systemcomposer.createModel("archModel");
    rebindTargetModel(allocSet,"archModel")

    输入参数

    全部折叠

    分配集,指定为 systemcomposer.allocation.AllocationSet 对象。

    目标模型的名称,指定为字符向量或字符串。

    示例: "archModel"

    数据类型: char | string

    详细信息

    全部折叠

    版本历史记录

    在 R2024a 中推出