Model Arrays of Buses - MATLAB & Simulink (original) (raw)

Main Content

Arrays of buses represent structured data compactly, eliminating the need to include multiple copies of the same buses. Arrays of buses support iterative processing with for-each subsystems.

The input buses for an array of buses must be nonvirtual and of the same data type, having the same names, hierarchies, and attributes for the bus elements.

The example model demonstrates multiple ways to use an array of buses. To simulate the model, on the Modeling tab of the SimulinkĀ® Toolstrip, click Run. Alternatively, in the MATLABĀ® Command Window, enter these commands.

mdl = "ArraysOfBuses"; open_system(mdl) sim(mdl);

ArraysOfBuses model after simulation

In this model, a Vector Concatenate block creates an array of buses from nonvirtual buses. Bus Creator blocks create two of the nonvirtual buses, and a Constant block creates a nonvirtual bus from a struct.

The model uses the array of buses with:

See Also

Vector Concatenate

Topics