Main Content

Composite Signals

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

To simplify model appearance, combine individual signals into composite signals using these techniques:

  • Virtual buses

  • Nonvirtual buses

  • Mux signals

  • Concatenated signals

For a detailed comparison of composite signals, see Types of Composite Signals.

Virtual buses meet most modeling requirements for combining signals into a composite signal and give you flexibility for combining different types of signals.


expand all

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


expand all

Simulink.Bus Specify properties of buses
Simulink.BusElement Specify properties of elements of buses
Simulink.Bus.cellToObjectConvert cell array containing bus information to Simulink.Bus objects
Simulink.Bus.createObjectCreate Simulink.Bus objects from blocks or MATLAB structures
Simulink.Bus.objectToCellUse Simulink.Bus objects to create cell array containing bus information
Simulink.Bus.saveSave Simulink.Bus objects in function
Simulink.Bus.createMATLABStructCreate MATLAB structures that use the same hierarchy and attributes as buses
Simulink.BlockDiagram.addBusToVectorConvert virtual bus signals into vector signals by adding Bus to Vector blocks


Bus EditorCreate, modify, and manage Simulink.Bus objects
Model ExplorerView, modify, and add elements of Simulink models, Stateflow charts, and workspace variables


Composite Signal Basics

Types of Composite Signals

Reduce visual complexity in a model by combining signals into a composite signal.

Bus-Capable Blocks

Identify the blocks that support virtual buses, nonvirtual buses, and arrays of buses.

Visually Group Lines

Group Signal Lines into Virtual Buses

Combine signals into virtual buses, which only affect visual appearance.

Simplify Subsystem and Model Interfaces with Buses

Use In Bus Element and Out Bus Element blocks for bus inputs and outputs.

Display Bus Information

Display information about buses, such as signal hierarchy and whether the bus is virtual or nonvirtual.

Identify Automatic Bus Conversions

Recognize modeling patterns that cause hidden Bus To Vector and Signal Conversion blocks.

Modify and Configure Buses

Modify Bus Hierarchy

Change the order and hierarchy of nested buses and their elements.

Replace Values of Bus Elements

Use a Bus Assignment block to assign values to elements of a bus.

Specify Initial Conditions for Bus Elements

Specify bus element values as initial conditions for buses.

Share and Reuse Bus-Routing Blocks

Share blocks that create or interact with buses using subsystem references or custom libraries.

Define Bus Object Data Types

Specify Bus Properties with Simulink.Bus Object Data Types

Understand Simulink.Bus object uses and implementation.

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.

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.

Functionally Group Lines

Create Nonvirtual Buses

Create buses that appear in generated code and support modeling constructs such as arrays of buses.

Modify Sample Times for Nonvirtual Buses

Make the sample time of signals the same so that you can group them in a nonvirtual bus.

Generate Code for Nonvirtual Buses

Use a structure in code generation to represent a nonvirtual bus. Control data types of initial condition structure fields.

Inspect Generated Code for Nonvirtual Buses

Find nonvirtual buses in generated code for a simple model.

Simplify Iterative Processing

Group Nonvirtual Buses in Arrays of Buses

Streamline a model by combining nonvirtual buses that have the same data type into an array.

Work with Arrays of Buses

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.

Related Information

Featured Examples