Package: rtw.codegenObjectives
Superclasses:
Customize code generation objectives
An rtw.codegenObjectives.Objective
object creates
a code generation objective.
rtw.codegenObjectives.Objective | Create custom code generation objectives |
addCheck | Add checks |
addParam | Add parameters |
excludeCheck | Exclude checks |
modifyInheritedParam | Modify inherited parameter values |
register | Register objective |
removeInheritedCheck | Remove inherited checks |
removeInheritedParam | Remove inherited parameters |
setObjectiveName | Specify objective name |
Handle. To learn how this affects your use of the class, see Copying Objects in the MATLAB® Programming Fundamentals documentation.
Create a custom objective named Reduce RAM Example
.
The following code is the contents of the sl_customization.m
file
that you create.
function sl_customization(cm) %SL_CUSTOMIZATION objective customization callback objCustomizer = cm.ObjectiveCustomizer; index = objCustomizer.addCallbackObjFcn(@addObjectives); objCustomizer.callbackFcn{index}(); end
function addObjectives % Create the custom objective obj = rtw.codegenObjectives.Objective('ex_ram_1'); setObjectiveName(obj, 'Reduce RAM Example'); % Add parameters to the objective addParam(obj, 'DefaultParameterBehavior', 'Inlined'); addParam(obj, 'BooleanDataType', 'on'); addParam(obj, 'OptimizeBlockIOStorage', 'on'); addParam(obj, 'EnhancedBackFolding', 'on'); addParam(obj, 'BooleansAsBitfields', 'on'); % Add additional checks to the objective % The Code Generation Advisor automatically includes 'Check model % configuration settings against code generation objectives' in every % objective. addCheck(obj, 'mathworks.design.UnconnectedLinesPorts'); addCheck(obj, 'mathworks.design.Update'); %Register the objective register(obj); end