- Types of Model Coverage: Signal Size Coverage - Types of Model Coverage - MATLAB & Simulink
- Top-Level Model Coverage Report: Signal Size Coverage for Variable-Dimension Signals - Top-Level Model Coverage Report - MATLAB & Simulink
How do I get 100% Simulink Coverage when using fixed-size signals as input?
3 views (last 30 days)
Show older comments
MathWorks Support Team
on 4 Nov 2025 at 0:00
Answered: MathWorks Support Team
on 6 Nov 2025 at 21:51
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?
Accepted Answer
MathWorks Support Team
on 4 Nov 2025 at 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:
0 Comments
More Answers (0)
See Also
Categories
Find more on Get Started with Simulink Coverage in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!