How do I get 100% Simulink Coverage when using fixed-size signals as input?

3 visualizzazioni (ultimi 30 giorni)
I am struggling to get 100% coverage with Simulink Coverage for a model that uses a fixed-length array as an input. What is the proper way to create and add test cases for this specific scenario?

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 4 Nov 2025 alle 0:00
In general, fixed-size signals sizes are adjusted between runs and when this happens, it will affect the number of outcomes that Simulink Coverage will need to record, and in turn this changes the coverage checksum between runs thus making the coverage results incompatible for aggregation. For example, if the signal is an input to a block which receives Decision coverage (such as the control port of a Switch) then this will change the number of Decision objective outcomes. More commonly, though, the change in signal size causes a change in the number of outcomes for the Signal Range metric.
This is currently a limitation of Simulink Coverage that the Signal Range metric affects the coverage checksum even if this metric is not enabled in the coverage settings. As a result, changes in the size of fixed-size signals between runs will almost always result in incompatible coverage.
The potential workaround is to make use of variable-size signals. When variable-size signals are used, the Simulink Coverage tool is able to account for the fact that the size of signals is expected to change, within a specified range, and results are recorded and reported accordingly. You may find some examples for this in the following doc pages:
  1. Types of Model Coverage: Signal Size Coverage - Types of Model Coverage - MATLAB & Simulink
  2. Top-Level Model Coverage Report: Signal Size Coverage for Variable-Dimension Signals - Top-Level Model Coverage Report - MATLAB & Simulink

Più risposte (0)

Categorie

Scopri di più su Get Started with Simulink Coverage in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by