%% Model Reference Function-Call 
% This example shows how to use a Model block that is explicitly triggered
% by means of its function-call trigger port.

% Copyright 1990-2020 The MathWorks, Inc.

%% Examine Example Model
% Open the example model.
open_system('sldemo_mdlref_fcncall');

%%
% This model contains three Model blocks: 500ms Counter, 1 sec Counter and
% Asynchronous Counter. These blocks reference the same model
% (|sldemo_mdlref_fcncall_cntr|). The Model blocks represent saturating
% counters that increment their output values by one each time they are
% explicitly triggered through their function-call trigger ports. The
% Stateflow(R) chart calls each Model block at its specified rate.

%% Simulate Model and Examine Results
% Simulate the model, and verify the behavior of the counters by examining
% the results displayed by the scope.
sim('sldemo_mdlref_fcncall');
%%
% <<../sldemo_mdlref_fcncall_scope.png>>