| Simulink® Verification and Validation™ | ![]() |
Display modified condition/decision coverage information for model object
coverage = mcdcinfo(cvdo, object)
coverage = mcdcinfo(cvdo, object, ignore_descendants)
[coverage, description] = mcdcinfo(cvdo, object)
coverage = mcdcinfo(cvdo, object) returns modified condition/decision coverage results from the cvdata object cvdo for the model component specified by object. See Specifying a Model Object for more information about the object argument. The value of coverage is a two-element vector of form [covered_outcomes total_outcomes], the elements of which are defined as follows:
covered_outcomes — the number of condition/decision outcomes satisfied for object
total_outcomes — the total number of condition/decision outcomes for object
Note coverage is empty if cvdo does not contain modified condition/decision coverage results for object. |
coverage = mcdcinfo(cvdo, object, ignore_descendants) returns modified condition/decision coverage results for object, ignoring the coverage of its descendent objects if ignore_descendants is true (i.e., 1).
[coverage, description] = mcdcinfo(cvdo, object) returns modified condition/decision coverage results and textual descriptions of each condition/decision in object. description is a structure array containing the following fields:
text — string denoting whether the condition/decision is associated with a block output or Stateflow® transition
condition.text — string describing a condition/decision or the block port to which it applies
condition.achieved — logical array indicating whether a condition case has been fully covered
condition.trueRslt — string representing a condition case expression that produces a true result
condition.falseRslt — string representing a condition case expression that produces a false result
See MC/DC Analysis Table for more information about the data contained in these fields.
The object argument specifies an object in the Simulink® model or Stateflow diagram that received decision coverage. Valid values for object include the following:
| Object Specification | Description |
|---|---|
BlockPath | Full path to a Simulink model or block |
BlockHandle | Handle to a Simulink model or block |
slObj | Handle to a Simulink API object |
sfID | Stateflow ID |
sfObj | Handle to a Stateflow API object |
{BlockPath, sfID} | Cell array with the path to a Stateflow block and the ID of an object contained in that chart |
{BlockPath, sfObj} | Cell array with the path to a Stateflow block and a Stateflow object API handle contained in that chart |
[BlockHandle, sfID] | Array with a Stateflow block handle and the ID of an object contained in that chart |
The following commands open the slvnvdemo_cv_small_controller demo model, create the test specification object testObj, enable modified condition/decision coverage for testObj, and execute testObj.
mdl = 'slvnvdemo_cv_small_controller'; open_system(mdl) testObj = cvtest(mdl) testObj.settings.mcdc = 1; data = cvsim(testObj)
Afterward, issue the following commands to retrieve the modified condition/decision coverage results for the Logic block (in the Gain subsystem) and determine its percentage of condition/decision outcomes covered.
blk_handle = get_param([mdl, '/Gain/Logic'], 'Handle'); cov = mcdcinfo(data, blk_handle) percent_cov = 100 * cov(1) / cov(2)
![]() | decisioninfo | ModelAdvisor.Action | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |