| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Model Verification

The Assertion block checks whether any of the elements of the input signal is zero. If all elements are nonzero, the block does nothing. If any element is zero, the block halts the simulation, by default, and displays an error message. Use the block parameter dialog box to:
Specify that the block should display an error message when the assertion fails but allow the simulation to continue.
Specify a MATLAB® expression to evaluate when the assertion fails.
Enable or disable the assertion.
You can also use the Model Verification block enabling setting on the Data Validity diagnostics pane of the Configuration Parameters dialog box to enable or disable all Assertion blocks in a model.
The Assertion block and its companion blocks in the Model Verification library are intended to facilitate creation of self-validating models. For example, you can use model verification blocks to test that signals do not exceed specified limits during simulation. When you are satisfied that a model is correct, you can turn error checking off by disabling the verification blocks. You do not have to physically remove them from the model. If you need to modify a model, you can temporarily turn the verification blocks back on to ensure that your changes do not break the model.
Note For information about how Real-Time Workshop® generated code handles Model Verification blocks, see Enabling Instrumentation for Debugging in the Real-Time Workshop User's Guide. |
The Assertion block accepts input signals of any dimensions and any numeric data type supported by Simulink software, including fixed-point data types.
For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink.

Clearing this check box disables the Assertion block, that is, causes the model to behave as if the Assertion block did not exist. The Model Verification block enabling setting under Debugging on the Data Validity diagnostics pane of the Configuration Parameters dialog box lets you enable or disable all Assertion blocks in a model regardless of the setting of this option.
A MATLAB expression to evaluate when the assertion fails.
Selecting this check box causes the Assertion block to halt the simulation when the block input is zero and display an error message in the Simulation Diagnostics viewer. Otherwise, the block displays a warning message in the MATLAB Command Window and continues the simulation.
Enter the time interval between sample time hits or specify another appropriate sample time such as continuous. By default, the block inherits its sample time based upon its context within the model. See Working with Sample Times.
Direct Feedthrough | No |
Sample Time | Specified in the Sample time parameter |
Scalar Expansion | No |
Dimensionalized | Yes |
Multidimensionalized | Yes |
Zero-Crossing Detection | No |
![]() | Algebraic Constraint | Assignment | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |