Main Content

Advisor.removeExclusion

Removes exclusions from model or exclusion file

Since R2021a

Description

Advisor.removeExclusion(modelName,filterType,entityIdentifier) removes an exclusion from an entity, like a block, subsystem, or Stateflow® element, in the model. The type of exclusion is specified by the filterType argument. The entity is specified by the entityIdentifier argument.

To clear all exclusions from a model or exclusion file, use Advisor.clearExclusion instead.

Advisor.removeExclusion(modelName,'object',exclusionObject) removes an exclusion from using an exclusion object. You can get an exclusion object by using the function Advisor.getExclusion.

To clear all exclusions from a model or exclusion file, use Advisor.clearExclusion instead.

Input Arguments

collapse all

Model to remove exclusions from, specified as a character vector or string array.

Data Types: char | string

Type of entity exclusion that you want to remove, specified as one of these values.

ValueDescription
BlockSimulink® block
BlockTypeBlocks with a specific BlockType property value
SubsystemBlocks inside a subsystem
LibraryInstances of a library block
MaskTypeBlocks or subsystems with a specific MaskType property value
StateflowStateflow blocks in Simulink
ChartEvery entity inside Stateflow chart
StateStateflow State
TransitionStateflow Transition
JunctionStateflow Junction
GraphicalFunctionStateflow Graphical Function
MatlabFunction

Stateflow MATLAB® Function

SimulinkFunction

Stateflow Simulink Function

TruthTableStateflow Truth Table
SimulinkBasedStateSimulink based state in Stateflow

Example: Advisor.removeExclusion('mymodel', 'Block', 'mymodel/Constant')

Data Types: char | string

Identifier for the entity exclusion that you want to remove, specified as a BlockType property value, MaskType property value, or pathname.

If you specified the filterType argument as:

  • BlockType, then specify a BlockType value.

    You can use the functions gcb and get_param to get the currently selected block and the block type. For example:

    myblock = gcb;
    blockType = get_param(myblock,'BlockType');
    Advisor.removeExclusion('mymodel','BlockType',blockType);

  • MaskType, then specify a MaskType value.

    You can use the functions gcb and get_param to get the currently selected entity and the mask type. For example:

    blockWithMask = gcb;
    maskType = get_param(blockWithMask,'MaskType');
    Advisor.removeExclusion('mymodel','MaskType',maskType);

  • Any other filterType argument, then specify the pathname for the entity.

    You can use the function gcb to get the pathname for an entity. For example:

    myblock = gcb;
    Advisor.removeExclusion('mymodel','Block',myblock)

Example: Advisor.removeExclusion('mymodel', 'Block', 'mymodel/Constant')

Data Types: char | string

Exclusion that you want to remove, specified as an exclusion object AdvisorFilterSpecification. Advisor.removeExclusion uses the exclusion object to determine the type and identifier.

To get an exclusion object, use the function Advisor.getExclusion.

exclusions = Advisor.getExclusion('mymodel'); 
Advisor.removeExclusion('mymodel', 'object', exclusions(1));

Example: Advisor.removeExclusion('mymodel', 'object', exclusions(1));

Alternative Functionality

Model Advisor Exclusion Editor

You can also remove an exclusion by using the Model Advisor Exclusion Editor. To open the Model Advisor Exclusion Editor for a model, right-click in the Simulink canvas or right-click an entity and select Model Advisor > Open Model Advisor Exclusion Editor. In the Model Advisor Exclusion Editor dialog box, select the exclusion that you want to remove and click the Delete exclusion row button . For more information, see Exclude Blocks from Model Advisor Check Analysis.

Version History

Introduced in R2021a

expand all