| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
A composite signal is a signal that is composed of other signals. The constituent signals originate separately and join to form the composite signal. They can then be extracted from the composite signal downstream and used as if they had never been joined. Composite signals can reduce visual complexity in models by grouping signals that run in parallel over some or all of their courses, and can serve various other purposes.
A Simulink composite signal is called a bus signal, or just a bus. A Simulink bus is analogous to a bundle of wires held together by tie wraps. Simulink implements a bus as a name-based hierarchical structure. A Simulink bus should not be confused with a hardware bus, like the bus in the backplane of many computers. It is more like a programmatic structure defined in a language like C.
The signals that constitute a bus are called elements. The constituent signals retain their separate identities within the bus and can be of any type or types, including other buses nested to any level. The elements of a bus can be any of the following:
Mixed data type signals (e.g. double, integer, fixed point)
Mixture of scalar and vector elements
Buses as elements
N-D signals
Mixture of Real and Complex signals
Some requirements and limitations apply when you connect buses to blocks or to nonvirtual subsystems. See Bus-Capable Blocks, Connecting Buses to Inports and Outports, and Composite Signal Limitations for more information.
A bus can be either virtual or nonvirtual. Both virtual and nonvirtual buses provide the same visual simplification, but their implementations are different.
Virtual buses exist only graphically. They have no functional effects and do not appear in generated code; only the constituent signals appear. See Virtual Signals for details. Simulink implements virtual buses with pointers, so virtual buses add no data copying overhead and do not affect performance.
Nonvirtual buses may have functional effects. They appear as structures in generated code, which can simplify the code and clarify its correspondence with the model. Simulink implements nonvirtual buses by copying data from the source signals to the bus, which can affect performance.
The two types of buses are interchangeable for many purposes, but some situations require a nonvirtual bus. See Virtual and Nonvirtual Buses for more information.
If all signals in a bus are the same type, you may be able to use a contiguous vector or a virtual vector (mux) instead of a bus. See Mux Signals for more information. In some cases, muxes and virtual buses can be treated interchangeably; implicit type conversion occurs when needed. However, The MathWorks discourages treating muxes and buses interchangeably. The practice may become unsupported in the future, and should not be used in new applications. Simulink software provides diagnostics that report cases where muxes and virtual buses are used interchangeably, and includes capabilities that you can use to upgrade a model to eliminate such mixtures. See Avoiding Mux/Bus Mixtures for details.
A bus can have an associated bus object, which can both provide and validate bus properties. A bus object is an instance of class Simulink.Bus that is defined in the base workspace. The object defines the structure of the bus and the properties of its elements, such as nesting, data type, and size. Bus objects are optional for virtual buses and required for nonvirtual buses. See Using Bus Objects for more information. You can create bus objects programmatically or by using the Simulink Bus Editor, which facilitates bus object creation and management. See Using the Bus Editor for more information.
The various techniques for defining buses are essentially equivalent for simulation, but the techniques used can make a significant difference in the efficiency, size, and readability of generated code. If you intend to generate production code for a model that uses buses, see Optimizing Buses for Code Generation for information about the best techniques to use.
![]() | Using Composite Signals | Creating and Accessing a Bus | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |