Composite Signals

Use composite signals, such as buses, to group signals and reduce model complexity

To simplify model layout, use these techniques to combine individual signals into composite signals:

  • A virtual or nonvirtual bus — Combine signals using a Bus Creator block and access individual signals based on name with a Bus Selector block.

  • An array of buses — Combine similar nonvirtual bus signals into a Vector Concatenate or Vector Concatenate block and select buses using Selector and Bus Selector blocks.

  • A mux — Connect signals of the same type using a Mux block and access individual signals using a Demux block.

  • A concatenated vector or matrix of signals — Combine signals using a Vector Concatenate or Vector Concatenate block.

Using virtual buses meets most modeling requirements for combining signals into a composite signal. Virtual buses give you flexibility for combining different types of signals. Compared to nonvirtual buses, virtual buses are simpler to use, require less memory, and usually simulate faster. For an example of using virtual buses, see Getting Started with Buses. For a comparison of approaches to creating composite signals, see Select a Composite Signal Technique.


Bus AssignmentReplace specified bus elements
Bus CreatorCreate bus signal from input signals
Bus SelectorSelect signals from incoming bus
In Bus Element Select signal that connects to input port
Out Bus ElementSpecify signal that connects to output port
Bus to VectorConvert virtual bus to vector
DemuxExtract and output elements of virtual vector signal
MuxCombine input signals of same data type and numeric type into virtual vector
Vector Concatenate, Matrix ConcatenateConcatenate input signals of same data type to create contiguous output signal
Signal ConversionConvert signal to new type without altering signal values


expand all

Simulink.BlockDiagram.addBusToVectorConvert virtual bus signals into vector signals by adding Bus to Vector blocks
Simulink.Bus.cellToObjectConvert cell array containing bus information to bus objects
Simulink.Bus.createMATLABStructCreate MATLAB structures using same hierarchy and attributes as bus signals
Simulink.Bus.createObjectCreate bus objects from blocks or MATLAB structures
Simulink.Bus.objectToCellUse bus objects to create cell array containing bus information
Simulink.Bus.saveSave bus objects in MATLAB file


Simulink.Bus Specify properties of bus signal
Simulink.BusElement Describe element of bus signal


Composite Signal Basics

Composite Signal Techniques

Get an overview of the techniques you can use to combine signals into a composite signal.

Select a Composite Signal Technique

Choose the composite signal technique that meets your modeling requirements.

Getting Started with Buses

Use Bus Creator and Bus Selector blocks to combine signals into virtual and nonvirtual buses and select signals from those buses.

Bus Creation Using Bus Creator Blocks

Name, rearrange, and browse bus signals created using Bus Creator blocks. Use a bus object as the output data type.

Simplify Subsystem Bus Interfaces

Use In Bus Element and Out Bus Element for bus signal inputs and outputs to subsystems.

Display Information About Buses

Display information about bus signals, such as paths and the kind of bus.

Bus Signal Routing

Bus-Capable Blocks

Identify the blocks that support bus signals as inputs.

Nest Buses

Include a bus signal in another bus signal, creating a hierarchy of nested bus signals.

Assign Signal Values to a Bus

Use a Bus Assignment block to assign the values of a signal to elements of a bus. Change bus element values without adding Bus Selector and Bus Creator blocks to select bus elements and reassemble them into a bus.

Specify Bus Signal Sample Times

All signals in a nonvirtual bus must have the same sample time, even if the elements of the associated bus object specify inherited sample times. You can use a Rate Transition block to apply the same sample time to each bus element.

Specify Initial Conditions for Bus Signals

Specify bus element values as initial conditions for bus signals.

Correct Buses Used as Vectors

Modify models that use bus signals as muxes by using the Model Advisor or manually changing your model.

Arrays of Buses

Combine Buses into an Array of Buses

Streamline a model by combining nonvirtual bus signals that have the same bus type (use the same bus object) into an array of buses.

Use Arrays of Buses in Models

Use array of bus signals in a model, load array of bus data, and log array of bus signals.

Work with Array of Buses Signals

Set up your model to use an array of buses to select signals, assign values to a signal, perform iterative processing, log and load signals, and initialize signals.

Convert Models to Use Arrays of Buses

Convert an existing model that does not use arrays of buses to use arrays of buses.

Bus Signals at Model Interfaces

Buses at Model Reference Interfaces

Use bus signals with root-level input and output blocks, atomic subsystem nonvirtual input blocks, and referenced models.

Bus Conversion

As part of simulation and code generation for S-Function blocks and Stateflow® charts, Simulink® automatically converts a virtual bus to a nonvirtual bus and nonvirtual buses to virtual buses, as necessary.

Bus Data Crossing Model Reference Boundaries

Use bus signals that cross the boundary between a model that contains a Model block and the referenced model.

Buses and Libraries

Use bus signals in a library block.

Generate Code for Bus Signals

Code generation for virtual and nonvirtual buses produces different results. Nonvirtual bus code generation creates a structure to represent the bus. You can control data types of initial condition structure fields.

Trace Connections Using Interface Display

Display interfaces to trace signals through the nested levels, annotate signal characteristics, and view units associated with signals.

Display Signal Attributes at Model Load Time

Display signal attributes at load time without compiling.

Find Attribute Mismatches Between Components

Find mismatching signal attributes at load time without compiling.

Bus Objects

When to Use Bus Objects

Understand what bus objects are and when and how you can use them.

Create Bus Objects with the Bus Editor

Create and manage bus objects using the Bus Editor.

Create Bus Objects Programmatically

Use functions and classes to define bus objects and bus elements, create bus objects from blocks, or create bus objects from MATLAB® data.

Modify Bus Objects

Change bus object and bus element properties or add and delete bus elements.

Save and Import Bus Objects

Store bus objects in a data dictionary, MATLAB file, MAT-file, or an external source file, such as a database file. Load bus objects from these files into the base workspace.

Customize Bus Object Import and Export

Customize the Bus Editor import and export commands by writing MATLAB functions that provide the desired capabilities. Register these functions using the Simulink Customization Manager.

Map Bus Objects to Models

Associate bus objects with models and keep track of those associations.

Featured Examples