%% Variant Subsystem with Enable Subsystem as Choice
% This example shows how to use Variant Subsystem model with Enable Subsystem as choice. 

% Copyright 2018 The MathWorks, Inc.

%% 
% Consider this model with a Variant Subsystem block.
%
% *Note:* If you use Enable Subsystem as a variant choice for the Linear
% Subsystem block then the other Subsystem block (Nonlinear) within the
% Variant Subsystem must also be Enable Subsystem.

%%
% <<../EnableSubsystem1.png>>
%%
% The Variant Subsystem block "Controller" gets the input from Sine Wave
% and Inport blocks. The "Controller" block has two Variant choices, Linear
% and Nonlinear. The Variant choices are governed by conditions VSSMODE==0
% and VSSMODE==1. This model can simulate and generate code based on
% VSSMODE value.
%% 
% <<../block_parameters.png>>
%%
% You can simulate the model slexVariantSubsystemEnableChoice and verify
% the behavior of the counters by examining the results.
%% Code Generation
% You can use the Simulink Coder to generate code from a model containing
% Variant Subsystem blocks. By default the generated code contains only the
% active variant. Alternatively, you can generate code for all variants
% guarded by C preprocessor conditionals (#if, #elif, #endif) when using
% the Embedded Coder.
% In the generated code, the code inside fcn definition is guarded by C
% preprocessor conditionals inside export function.

%step() {
% #if VSSMODE==0
% // code for Linear choice
% .......
% #elif VSSMODE==1
% // code for Nonlinear choice
% .......
% #endif
%% More about
%
% * <docid:simulink_ug.mw_1f8a3eb7-5636-4aec-a746-d18de76fe6f6 Variant Systems with Conditional Systems>
