| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Verification and Validation |
| Contents | Index |
| Learn more about Simulink Verification and Validation |
Add Recommended Action section and text
setRecAction(ft_obj, {text})
setRecAction(ft_obj, {text}) is an optional method that adds a Recommended Action section to the report. Use this method to describe how to fix the check.
ft_obj |
A handle to a template object. |
text |
A cell array of strings or handles to formatting objects, that describes the recommended action to fix the issues reported by the check. Valid formatting objects are: ModelAdvisor.Image, ModelAdvisor.LineBreak, ModelAdvisor.List, ModelAdvisor.Paragraph, ModelAdvisor.Table, and ModelAdvisor.Text. The Model Advisor displays the recommended action as a separate section below the list or table in the report. |
Create a list object, ft, find Gain blocks in the model, and recommend changing them:
ft = ModelAdvisor.FormatTemplate('ListTemplate');
% Find all Gain blocks
gainBlocks = find_system(gcs, 'BlockType','Gain');
% Find Gain blocks with expression evaluates to 1
for idx = 1:length(gainBlocks)
gainObj = get_param(gainBlocks(idx), 'Object');
resGain = slResolve(gainObj.Gain, gainObj.getFullName);
if ~isempty(resGain)
% Find the first index that computes to 1
if ~isempty(find(resGain == 1, 1))
setRecAction(ft, {'If you are using these blocks '...
'as buffers, you should replace them with '...
'Signal Conversion blocks'});
end
end
end| Customizing the Model Advisor — Describes how to create custom checks |
| Formatting Model Advisor Results — Describes how to format Model Advisor results |
![]() | setListObj (ModelAdvisor.FormatTemplate) | setRefLink (ModelAdvisor.FormatTemplate) | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |