Main Content

setRecAction

Add Recommended Action section and text

Syntax

setRecAction(ft_obj,recActionText)

Description

setRecAction(ft_obj,recActionText) 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

ft_obj

A handle to a template object.

recActionText

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.

Examples

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'});
end