Documentation

Simulink.Bus.objectToCell

Package:Simulink.Bus

Use bus objects to create cell array containing bus information

Description

example

cells= Simulink.Bus.objectToCell(busNames)creates a cell array of bus information from a set of bus objects in the MATLAB®基本工作区。单元阵列包含定义每个总线对象的下属单元格数组。输出单元格数组中元素的顺序对应于输入单元格数组中的名称顺序。

cells= Simulink.Bus.objectToCell(busNames,scope)creates a cell array of bus information from a set of bus objects in a data dictionary. The cell array contains subordinate cell arrays that define each bus object. The order of elements in the output cell array corresponds to the order of names in the input cell array.

Examples

collapse all

Use theSimulink.Bus.objectToCellfunction to create a cell array of information about bus objects in the base workspace.

打开一个已定义两个总线对象的模型,CONTROL主要的.

open_system(fullfile(matlabroot,'例子','simulink',...'ex_bus_object_tutorial_using_objects'))

Create a cell array of information about theCONTROLbus object.

cells = Simulink.Bus.objectToCell({'CONTROL'}); cells{1}
ans = 1x6 cell array {'CONTROL'} {0x0 char} {0x0 char} {'Auto'} {'-1'} {2x1 cell}

Input Arguments

collapse all

总线对象为其创建总线对象信息的单元格数组,该信息将其指定为单元格数组。将总线对象名称指定为字符向量。如果busNamesis empty, the function converts all bus objects in the base workspace or data dictionary.

Example:cells = Simulink.Bus.objectToCell({'busObject'})

数据字典,指定为Simulink.data.Dictionaryobject. Before you use this function, represent the dictionary with aSimulink.data.Dictionaryobject by using, for example, the金宝appsimulink.data.dictionary.greate或者Simulink.data.dictionary.openfunction.

如果scope为空,该函数使用MATLAB基本工作区作为总线对象的来源。

Example:cells = Simulink.Bus.objectToCell({},dataDictionaryObject)

Output Arguments

collapse all

总线对象信息,specified as a cell array of cell arrays. Each subordinate cell array contains this bus object information:

  1. Bus name

  2. 标题文件

  3. Description

  4. 数据范围

  5. Alignment

  6. Elements

元素字段是一个包含每个总线元素的数据的数组:

  1. Bus element name

  2. Dimensions

  3. 数据类型

  4. Sample time

  5. Complexity

  6. Sampling mode

元素字段(如果可用)也包含此数据:

  1. 维度模式

  2. Minimum

  3. 最大

  4. 单位

  5. Description

尖端

The inverse function is金宝appsimulink.bus.celltoObject.

兼容性考虑

expand all

Not recommended starting in R2019b

Not recommended starting in R2016b

Introduced in R2007a