Why does a Simulink Test Test Case with enums fail despite setting Time Tolerance?

Simulink Test with an enum test case is failing because the simulation enum output is slightly lagging behind the test baseline enum value. A small lagging time tolerance was added to compensate, but the test is still failing despite the time tolerance being larger than the delay between the simulation output and baseline.
Why is this happening? Please advise.

 Accepted Answer

If the particular test case is using enums as opposed to numerical values and the interpolation method is chosen to be "linear" instead of "zoh", Simulink Test will attempt to interpolate between the enum's backing numerical values linearly as opposed using a zero-order-hold for the time tolerance. This will produce unexpected results or test failures.
Once the test case interpolation method is adjusted to "zoh", this test case should pass as expected.

More Answers (0)

Products

Release

R2017b

Community Treasure Hunt

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

Start Hunting!