function isEnabled = assessModelRefEnabled(modelName, modelRefEnable, modelRefExcludeList)
% Determine if the specified modelref would be enabled based on the
% settings modelRefEnable and modelRefExcludeList (as provided by the top
% model).

%   Copyright 2018 The MathWorks, Inc.

if strcmpi(modelRefEnable,'all') || strcmpi(modelRefEnable,'on')
    isEnabled = true;
elseif strcmpi(modelRefEnable, 'filtered')
    if any(strcmp(modelName, modelRefExcludeList))
        isEnabled = false;
    else
        isEnabled = true;
    end
else % 'none','off'
    isEnabled = false;
end
