This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Use bus objects to create cell array containing bus information


busCells = Simulink.Bus.objectToCell(busNames)



busCells = Simulink.Bus.objectToCell(busNames) inputs a cell array of names of bus objects that are in the MATLAB® base workspace. The function returns a cell array of cell arrays in which each subordinate cell array contains the bus information defined by one of the bus objects. The order of the elements in the output cell array corresponds to the order of the names in the input cell array.


collapse all

Use the Simulink.Bus.objectToCell function to create a cell array of information about bus objects in the base workspace.

Open a model that has two bus objects defined, CONTROL and MAIN.


Create cell array of information about the CONTROL bus object.

busCells = Simulink.Bus.objectToCell({'CONTROL'});
ans =

  1×6 cell array

    'CONTROL'    ''    ''    'Auto'    '-1'    {2×1 cell}

Input Arguments

collapse all

Bus objects in the base workspace for which to create cell arrays of bus object information, specified as a cell array of names of bus objects. Specify the bus object names as character vectors. If busNames is empty, the function converts all bus objects in the base workspace.

Output Arguments

collapse all

Bus object information, specified as a cell array of cell arrays. Each subordinate cell array contains bus object information, using these data fields:

  • Bus name

  • Header file

  • Description

  • Data scope

  • Alignment

  • Elements

The elements field is an array containing this data for each element:

  • Element name

  • Dimensions

  • Data type

  • Sample time

  • Complexity

  • Dimensions mode

  • Minimum

  • Maximum

  • Units

  • Description


The inverse function is Simulink.Bus.cellToObject.

Introduced in R2007a

Was this topic helpful?