%% Verify a SimBiology Model while Using Configset and Dose Objects
% Load a sample SimBiology model.

sbioloadproject radiodecay.sbproj

%
% Get the default configuration set from the model.

defaultConfigSet = getconfigset(m1,'default');

%
% Add a scheduled dose of 100 molecules at 2 seconds for species x.

dObj = adddose(m1,'d1','schedule');
dObj.Amount = 100;
dObj.AmountUnits = 'molecule';
dObj.TimeUnits = 'second';
dObj.Time = 2;
dObj.TargetName = 'unnamed.x';

%
% Verify the model while using the default configset object and added dose object.

verify(m1,defaultConfigSet,dObj);

%
% After verification, check the latest errors and warnings if there is any.

sbiolasterror

%
%

sbiolastwarning

%
%
% Simulate the model using the same configset and dose objects.

sim = sbiosimulate(m1,defaultConfigSet,dObj);

%
% Plot the result.

sbioplot(sim);

% Copyright 2012 The MathWorks, Inc.