To simplify model appearance, use these techniques to combine individual signals into composite 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. Virtual buses give you flexibility for combining different types of signals.
|Vector Concatenate, Matrix Concatenate||Concatenate input signals of same data type to create contiguous output signal|
|Selector||Select input elements from vector, matrix, or multidimensional signal|
|Mux||Combine input signals of same data type and numeric type into virtual vector|
|Demux||Extract and output elements of virtual vector signal|
|Convert cell array containing bus information to bus objects|
|Create MATLAB structures using same hierarchy and attributes as bus signals|
|Create bus objects from blocks or MATLAB structures|
|Use bus objects to create cell array containing bus information|
|Save bus objects in MATLAB file|
|Bus Editor||Create, modify, and manage Simulink.Bus objects|
To reduce visual complexity in a model, combine signals into a composite signal.
Use Bus Creator and Bus Selector blocks to combine signals into virtual and nonvirtual buses and select signals from those buses.
Use In Bus Element and Out Bus Element blocks for bus inputs and outputs.
Display information about bus signals, such as paths and the kind of bus.
Nonvirtual buses affect simulation and code generation.
Identify the blocks that support bus signals as inputs.
Include a bus signal in another bus signal, creating a hierarchy of nested bus signals.
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.
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 bus element values as initial conditions for bus signals.
Modify models that use bus signals as muxes by using the Model Advisor or manually changing your model.
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 array of bus signals in a model, load array of bus data, and log array of bus 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 an existing model that does not use arrays of buses to use arrays of buses.
Use bus signals with root-level input and output blocks, atomic subsystem nonvirtual input blocks, and referenced models.
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.
Use bus signals that cross the boundary between a model that contains a Model block and the referenced model.
Use bus signals in a library block.
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.
Display interfaces to trace signals through the nested levels, annotate signal characteristics, and view units associated with signals.
Display signal attributes at load time without compiling.
Find mismatching signal attributes at load time without compiling.
Understand bus object uses and implementation workflow.
Use functions and classes to define bus objects and bus elements, create bus objects from blocks, or create bus objects from MATLAB® data.
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.