Main Content

Model Arrays of Buses

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

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

The sldemo_bus_arrays model demonstrates multiple ways to use an array of buses.

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:

  • Selector blocks, to extract buses from the array of buses.

  • An Assignment block, to assign new values to a bus in the array.

  • A For Each Subsystem block, to iteratively process each bus in the array.

  • A Memory block, to output the array of buses input from the previous time step.

See Also

Related Topics