主要内容

Simulink.ModelTransform.BusTransformation.identify

识别需要变换的 Bus Selector 和 Bus Creator 模块

自 R2022b 起

说明

identificationResults = Simulink.ModelTransform.BusTransformation.identify(model) 返回 model 中存在的 Bus SelectorBus Creator 模块。为简化该模型,请使用 In Bus ElementOut Bus Element 模块作为输入和输出(而非使用 Bus Selector 模块作为输入,使用 Bus Creator 模块作为输出)。

示例

全部折叠

在模型中搜索符合条件的 Bus SelectorBus Creator 模块并存储结果。

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

  Results with properties:

          TopModel: 'VirtualBusPortCreationModel'
    BusHierarchies: {4×1 cell}
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'

输入参数

全部折叠

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

输出参量

全部折叠

识别出的可以变换为In Bus ElementOut Bus Element 模块的 Bus SelectorBus Creator 模块,以 Simulink.ModelTransform.BusTransformation.Result 对象形式返回。

版本历史记录

在 R2022b 中推出