excludeCheck - Exclude check from code generation objective - MATLAB (original) (raw)
Main Content
Exclude check from code generation objective
Syntax
Description
excludeCheck([objective](#mw%5Fcf26a6da-5062-4c94-a2f2-e10a770c5d33), [checkID](#mw%5Ff1f4771f-4d65-455d-adda-e377d28bbd42))
excludes the specified check from the Code Generation Advisor when you specify the objective. When you select multiple objectives, if you specify an additional objective that includes this check as a higher priority objective, the Code Generation Advisor includes this check.
Examples
Create a custom objective based on theTraceability
objective.
Create a file sl_customization.m
to contain a callback function that creates the custom objective.
function sl_customization(cm) %SL_CUSTOMIZATION objective customization callback
objCustomizer = cm.ObjectiveCustomizer; index = objCustomizer.addCallbackObjFcn(@addObjectives); objCustomizer.callbackFcn{index}();
end
Create and configure the objective in the addObjectives
function. Set the name of the objective and modify the list of checks, parameters, and values to verify. Then register the objective in the Code Generation Advisor.
function addObjectives
% Create the custom objective obj = rtw.codegenObjectives.Objective('ex_trace', 'Traceability'); setObjectiveName(obj, 'Custom Traceability Example');
% Remove inherited parameters from the objective removeInheritedParam(obj, 'MATLABFcnDesc'); removeInheritedParam(obj, 'MATLABSourceComments');
% Remove the inherited code instrumentation check removeInheritedCheck(obj, 'mathworks.codegen.CodeInstrumentation');
% Modify the inherited parameter 'ConvertIfToSwitch' and set the value to 'on' modifyInheritedParam(obj, 'ConvertIfToSwitch', 'on');
% Exclude the inherited check for the software environment excludeCheck(obj, 'mathworks.codegen.SWEnvironmentSpec');
%Register the objective register(obj);
end
Input Arguments
Code generation objective, specified as artw.codegenObjectives.Objective
object.
Identifier of check that you want to exclude, specified as a character vector or string scalar.
Example: 'mathworks.codegen.CodeInstrumentation'
Version History
Introduced in R2009a