%% 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.

% Copyright 1990-2020 The MathWorks, Inc.


%%
% 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).
%%
% Open the |sldemo_bus_arrays| model. 
load_system('sldemo_bus_arrays');
sim('sldemo_bus_arrays');
open_system('sldemo_bus_arrays');
%%
% In this model, a Vector Concatenate block creates an array of buses
% from nonvirtual buses, and a Constant block creates an array of buses
% from a struct.
% 
% The model uses the array of buses with:
%
% * Selector blocks, to extract nonvirtual buses from the array of buses.
% * An Assignment block, to assign 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.