%% Triggered Subsystems
% 
% This model shows triggered subsystems and describes the different trigger
% types. A triggered subsystem is executed for a single time step whenever
% the trigger port transitions in a specified direction. The transition of
% the trigger port may occur when the direction of the transition is
% rising, falling, or either rising or falling. A rising transition occurs
% when the trigger signal transitions from zero or below to a positive
% value. A falling transition occurs when the trigger signal transitions
% from zero or above to a negative value.
% 
% After running the simulation, look closely at the top plot in the scope.
% This shows a sine wave, a waveform, and the grounded value of zero. As
% the waveform transitions through zero, each of the subsystems is
% triggered appropriately. The output of each subsystem is equal to the
% current value of the sine wave at that time.
%
% Copyright 1990-2015 The MathWorks, Inc.

open_system('triggeredsub')
evalc('sim(''triggeredsub'')');
