%% Add Compartments
% This example shows how to add compartments to a SimBiology model.
% Create a SimBiology model which is named m1.

model = sbiomodel('m1');

%
% Add two compartments to the model, which are named as Central and Peripheral respectively.

comp1 = addcompartment(model,'Central');
comp2 = addcompartment(model,'Peripheral');

%
% Change the compartment capacities and units.

comp1.Capacity = 2;
comp1.CapacityUnits = 'liter';
comp2.Capacity = 1;
comp2.CapacityUnits = 'liter';

%
% Display all the compartments of the model.

model.Compartments

% Copyright 2015 The MathWorks, Inc.