Main Content


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.

Input Arguments


A handle to a template object.


A cell array of character vectors 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
for idx = 1:length(gainBlocks)
    gainObj = get_param(gainBlocks(idx), 'Object');

    setRecAction(ft, {'If you are using these blocks '...
    'as buffers, you should replace them with '...
    'Signal Conversion blocks'});