function Links1(varargin)
disp('Link ChemPlugin instances into a one-dimensional chain');

% Create the instances
nchain = 8;
cp_inlet = ChemPlugin();
cp = cell(nchain, 1);
for i = 1:nchain
    cp{i} = ChemPlugin();
end

% Link the instances into a chain
Link(cp{1}, cp_inlet);
for i = 2:nchain
    Link(cp{i}, cp{i-1});
end
Link(cp{nchain});

% Report the number of links to each instance
fprintf('Inlet is linked to %d instances\n', nLinks(cp_inlet));

for i  = 1:nchain
    fprintf('Instance %d is linked to %d instances\n', i,  nLinks(cp{i}));
end
end
