function result = coveragePointOrMcdcPredicateOfObjective(aObjective)
% coveragePointOrMcdcPredicateOfObjective: Given an objective, returns either the predicateIdx
% field if it is an MCDC objective, or returns the coveragePointIdx field if it is any other
% objective.

% Copyright 2022 The MathWorks, Inc.

    if contains(aObjective.type, 'MCDC')
        result = aObjective.predicateIdx;
    else
        result = aObjective.coveragePointIdx;
    end
end
