User`s guide
27 Create Procedural-Based Model Advisor Configurations
27-6
MAT6 = ModelAdvisor.Task('com.mathworks.sample.TaskSample6');
MAT6.DisplayName='Check model optimization settings';
MAT6.setCheck('com.mathworks.sample.Check3');
mdladvRoot.register(MAT6);
• The ModelAdvisor.Procedure.addTask method adds task MAT4 to
My Procedure and tasks MAT5 and MAT6 to My sub_Procedure. The
ModelAdvisor.Procedure.addProcedure method adds My sub_Procedure
to My Procedure:
% Add tasks to procedures:
% Add Task4 to MAP
MAP.addTask(MAT4);
% Now Add Task5 and Task6 to MAP_sub
MAP_sub.addTask(MAT5);
MAP_sub.addTask(MAT6);
% Include the Sub-Procedure in the Procedure
MAP.addProcedure(MAP_sub);
4
From the model window, select Analysis > Model Advisor > Model Advisor to
open the Model Advisor.
5
A System Selector — Model Advisor dialog box opens. Click OK. The Model
Advisor window opens.
6
In the left pane, expand My Procedure > My sub_Procedure. The Check
Simulink block font check is in the My Procedure folder. My sub_Procedure contains
Check Simulink window screen color and Check model optimization settings.
7
In the left pane of the Model Advisor, select My Procedure. In the right pane of
the Model Advisor, click Run All. The Model Advisor Check Simulink block font
check fails. The Model Advisor does not check the remaining two checks in the My
sub_Procedure folder. Running the checks in the My sub_Procedure folder depends
on passing the Check Simulink block font check.