主要内容

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

Simulink.ModelTransform.BusTransformation.Result 类

命名空间: Simulink.ModelTransform.BusTransformation

已识别的总线选择器和 Bus Creator 模块的结果

自 R2022b 起

描述

使用 Simulink.ModelTransform.BusTransformation.Result 类的对象来分析模型中符合条件的 Bus SelectorBus Creator 块的已识别结果。

创建对象

描述

Simulink.ModelTransform.BusTransformation.identify 函数在执行时创建一个 Simulink.ModelTransform.BusTransformation.Result 类的对象。您可以将此对象用作 Simulink.ModelTransform.BusTransformation.refactor 函数的输入参量。

注意

为避免模型重构出错,请勿更改 Simulink.ModelTransform.BusTransformation.Result 对象的属性。

属性

全部展开

顶层模型的名称,以字符数组或字符串标量的形式指定。

总线选择器和 Bus Creator 块的列表,指定为 Simulink.ModelTransform.BlockInfo 对象数组。

Simulink.ModelTransform.BlockInfo 对象具有以下属性:

模型中总线模块的路径,以字符向量的形式指定。

示例

全部折叠

分析符合条件的 Bus SelectorBus Creator 模块的结果。

打开模型 VirtualBusPortCreationModel。识别模型中的 Bus SelectorBus Creator 模块。

openExample('VirtualBusPortCreationModel')
identificationResults = Simulink.ModelTransform.BusTransformation.identify('VirtualBusPortCreationModel')
identificationResults =

  Results with properties:

          TopModel: 'VirtualBusPortCreationModel'
    BusHierarchies: {4×1 cell}

结果存储在 Simulink.ModelTransform.BusTransformation.Result 对象 identificationResults 中。

identificationResults.BusHierarchies
    4×1 cell array

        {1×1 Simulink.ModelTransform.BlockInfo}
        {1×1 Simulink.ModelTransform.BlockInfo}
        {1×1 Simulink.ModelTransform.BlockInfo}
        {1×1 Simulink.ModelTransform.BlockInfo}

hierarchy_1 = identificationResults.BusHierarchies{1} 
hierarchy_1 = 

  BlockInfo with properties:

    Path: 'VirtualBusPortCreationModel/Subsystem2/Bus Selector 2'

版本历史记录

在 R2022b 中推出