Contents

Bus Object API

The Simulink® software provides all Bus Editor capabilities programmatically. Many of these capabilities, like importing and exporting MATLAB® code files and MAT-files, are not specific to bus objects, and are described elsewhere in the MATLAB and Simulink documentation.

The classes that implement bus objects are:

Simulink.Bus

Specify the properties of a signal bus

Simulink.BusElement

Describe an element of a signal bus

The functions that create and save bus objects are:

Simulink.Bus.createObject

Create bus objects for blocks, optionally saving them in a MATLAB file in a specified format

Simulink.Bus.cellToObject

Convert a cell array containing bus information to bus objects in the base workspace

Simulink.Bus.objectToCell

Convert bus objects in the base workspace to a cell array containing bus information

Simulink.Bus.save

Export specified bus objects or all bus objects from the base workspace to a MATLAB file in a specified format

Simulink.Bus.createMATLABStruct

Create MATLAB structure with same hierarchy, names, and attributes as the bus signal

In addition, when you use Simulink.SubSystem.convertToModelReference to convert an atomic subsystem to a referenced model, you can save any bus objects created during the conversion to a MATLAB file.

Was this topic helpful?