Simulink.Bus.cellToObject

Package: Simulink.Bus

Convert cell array containing bus information to bus objects

Description

example

Simulink.Bus.cellToObject(busCells) creates a set of bus objects in the MATLAB® base workspace from a cell array of bus information.

Examples

collapse all

Create a cell array of cell arrays of bus information, and use that cell array to generate a bus object in the base workspace.

Create a cell array of bus information.

busCell = { ...
        { ...
            'myBusObj', ...
            'MyHeader.h', ...
            'My description', ...
            'Exported', ...
            '-1', ...
            {{'a',1,'double', [0.2 0],'real','Sample'}; ...
            {'b',1,'double', [0.2 0],'real','Sample',...
            'Fixed',-3,3,'m','b is distance from the origin'}},...
            }, ...
        };

Generate a bus object in the base workspace from the cell array.

Simulink.Bus.cellToObject(busCell)

Input Arguments

collapse all

Bus object information, specified as a cell array of cell arrays. Each subordinate cell array must contain this bus object information:

  1. Bus name

  2. Header file

  3. Description

  4. Data scope

  5. Alignment

  6. Elements

The elements field is an array that must contain this data for each element:

  1. Element name

  2. Dimensions

  3. Data type

  4. Sample time

  5. Complexity

  6. Sampling mode

The elements field array can also contain this data:

  1. Dimensions mode

  2. Minimum

  3. Maximum

  4. Units

  5. Description

Tips

The inverse function is Simulink.Bus.objectToCell.

Compatibility Considerations

expand all

Not recommended starting in R2019b

Not recommended starting in R2016b

Introduced before R2006a