function isVar = isVariantSubsystem(block)
%Test if block is a Variant Subsystem created by model discretizer

% Copyright 2020 The MathWorks, Inc.


isVar = 0;
try
    if strcmpi(get_param(block, 'BlockType'), 'Subsystem')
        if strcmpi(get_param(block,'Variant'), 'on')
            if ~isempty(get_param(block, 'ModelDiscInfo'))
                userDataAfterSplit = split(get_param(block, 'ModelDiscInfo'), ',');
                if strcmpi(userDataAfterSplit{1}, 'discretized')
                    isVar = 1;
                end
            end
        end
    end
catch
    isVar = 0;
end


%end isVariant

