| Simulink® Verification and Validation™ | ![]() |
coverage = decisioninfo(cvdo, object)
coverage = decisioninfo(cvdo, object, ignore_descendants)
[coverage, description] = decisioninfo(cvdo, object)
coverage = decisioninfo(cvdo, object) returns 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 decision outcomes satisfied for object
total_outcomes — the total number of decision outcomes for object
Note coverage is empty if cvdo does not contain decision coverage results for object. |
coverage = decisioninfo(cvdo, object, ignore_descendants) returns decision coverage results for object, ignoring the coverage of its descendent objects if ignore_descendants is true (i.e., 1).
[coverage, description] = decisioninfo(cvdo, object) returns decision coverage results and textual descriptions of decision points associated with object. description is a structure array containing the following fields:
decision.text — string describing a decision point, e.g., 'U > LL'
decision.outcome.text — string describing a decision outcome, i.e., 'true' or 'false'
decision.outcome.executionCount — number of times a decision outcome occurred in a simulation
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 decision coverage for testObj, and execute testObj.
mdl = 'slvnvdemo_cv_small_controller'; open_system(mdl) testObj = cvtest(mdl) testObj.settings.decision = 1; data = cvsim(testObj)
Afterward, issue the following commands to retrieve the decision coverage results for the Saturation block and determine its percentage of decision outcomes covered.
blk_handle = get_param([mdl, '/Saturation'], 'Handle'); cov = decisioninfo(data, blk_handle) percent_cov = 100 * cov(1) / cov(2)
![]() | cvtest | mcdcinfo | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |