Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

setRecAction

Class: ModelAdvisor.FormatTemplate
Package: ModelAdvisor

Add Recommended Action section and text

Syntax

setRecAction(ft_obj, {text})

Description

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

ft_obj

A handle to a template object.

text

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

Was this topic helpful?