Examine Model Verification Results by Using Simulation Data Inspector
This example shows how to use the Simulation Data Inspector to view the output from a model verification block in a system under test. If you have Simulink® Test™, model verification blocks return
Untested results at each time step. By examining the results of a model verification block, you can:
Determine the simulation time when a failure occurs.
Compare the verification results with other relevant signals.
Trace failures from the Simulation Data Inspector back to the model.
For more information, see Model Verification Blocks.
Verify Model Behavior With Assertion Block
In this example, the subsystem block
Controller models the cruise control system in a car. This subsystem outputs the throttle value based on the difference between the actual and target speeds.
The verification subsystem
Safety Properties uses an Assertion block to check that the system disengages when the brake is applied for three consecutive time steps.
Determine Simulation Time of Failure
Simulate the model and view the output of the Assertion block in the Simulation Data Inspector.
In the Simulation tab, click Run.
In the Simulation tab, under Review Results, select Data Inspector.
In the Simulation Data Inspector navigation pane, select
The results show that the assertion fails at 0.23 seconds.
Compare Verification Results with Other Signals
Examine the cause of the failure by plotting the values of the brake and throttle signals.
throtsignal and select Log Selected Signals.
Simulate the model.
Configure the Simulation Data Inspector with two subplots.
In the Simulation Data Inspector navigation pane, select the signals to plot. For the first subplot, select
BrakeAssertion. For the second subplot, select
The results show that pressing the brake at 0.2 seconds does not disengage the throttle.
Trace Failure Back to the Model
Find the block that produces a verification result by tracing the result from the Simulation Data Inspector back to the model. In the Simulation Data Inspector navigation pane, right-click
BrakeAssertion and select Highlight in Model. The editor opens the verification subsystem and highlights the Assertion block.