%% Get Selector by Type and Description
% This example shows how to get a selector by type and description. In this
% example, you get all selectors for the False outcomes of the And block whose type is
% |ConditionOutcome|.

% Copyright 2020 The MathWorks, Inc.

%%
% Load the model into memory.

modelName = 'sldemo_lct_bus';
load_system(modelName);

%%
% Get the false outcome condition selectors for the And block by searching
% for descriptions that include |F|.

id = getSimulinkBlockHandle([modelName,'/slCounter/And']);
sel = slcoverage.Selector.allSelectors(id, ...
         'Type',slcoverage.MetricSelectorType.ConditionOutcome, ...
         'Description','F')

%%
% Look at the constructor code for the two selectors that were returned.
%

sel.ConstructorCode