Main Content

sldvblockreplacement

Replace blocks for analysis

Description

[status,newmodel] = sldvblockreplacement(model) copies the model model and replaces specified model blocks and other model components for a Simulink® Design Verifier™ analysis. sldvblockreplacement replaces the blocks of the model according to the block-replacement rules in the model configuration settings.

example

[status,newmodel] = sldvblockreplacement(model,options) replaces the blocks of the model model according to the block-replacement rules specified in the sldvoptions object options, and returns a handle to the new model in newmodel.

[status,newmodel] = sldvblockreplacement(model,options,showUI) performs the same tasks as sldvblockreplacement(model,options). If showUI is true, errors appear in the Diagnostic Viewer. Otherwise, errors appear at the MATLAB® command line.

Examples

collapse all

Replace the blocks in sldvdemo_sqrt_blockrep model by using the block-replacement rules specified in opts.

Open the sldvdemo_sqrt_blockrep example model.

openExample('sldv/BlockReplacementsForUnsupportedBlocksExample',...
'supportingFile','sldvdemo_sqrt_blockrep')

Set the sldvoptions and specify the block-replacement rule.

opts = sldvoptions;
opts.BlockReplacement = 'on';
opts.BlockReplacementRulesList = ['sldvdemo_custom_blkrep_rule_sqrt.m,' ...
                                  'blkrep_rule_lookup_normal.m,'...
                                  'blkrep_rule_switch_normal.m'];

Create a model by using sldvblockreplacement.

[status, newmodel] = sldvblockreplacement('sldvdemo_sqrt_blockrep', opts);

Input Arguments

collapse all

Name or handle to a Simulink model.

sldvoptions object that specifies the analysis parameters.

Logical value indicating where to display messages during analysis.

true to display diagnostic messages in the Diagnostic Viewer
false (default) to display messages in the MATLAB command window

Output Arguments

collapse all

If the operation replaces the blocks, sldvblockreplacement returns a status of 1. Otherwise, it returns 0.

sldvblockreplacement returns a handle to the new model in newmodel.

Version History

Introduced in R2007a