User`s guide
Create Callback Functions and Results
25-43
mdladvObj.setListViewParameters...
({mdladvObj.getListViewParameters{:}, myLVParam});
needEnableAction = true;
else
ResultDescription{end+1} = ModelAdvisor.Paragraph(['All block font sizes '...
'are identical.']);
ResultDetails{end+1} = {};
end
mdladvObj.setActionEnable(needEnableAction);
mdladvObj.setCheckErrorSeverity(1);
In the Model Advisor, if you run Example task with input parameter and auto-
fix ability for the slvnvdemo_mdladv model, you can view the hyperlinked results.
Clicking the first hyperlink, slvnvdemo_mdladv/Input, displays the Simulink model
with the Input block highlighted.
Action Callback Function
An action callback function specifies the actions that the Model Advisor performs on a
model or subsystem when the user clicks the action button. You must create one callback
function for the action that you want to take.
The action callback function takes the following arguments.
Argument I/O Type Description
taskobj Input The ModelAdvisor.Task object for the check that
includes an action definition.
result Output MATLAB string that supports Model Advisor
Formatting API calls or embedded HTML tags for text
formatting.
For a code example, see “Action Callback Function” on page 25-43
Action Callback Function with Result Details
The following is an example of an action callback function that contains result details.
% Get Simulink.ModelAdvisor object
mdladvObj = taskobj.MAObj;
% get result of 'MyCheck'
myResult = mdladvObj.getCheckResult('MyCheck');
% if the check is in style three
[ResultDescription, ResultDetails] = myResult;