Check whether signal is zero
Simulink / Model Verification
HDL Coder / Model Verification
The Assertion block checks whether any of the elements of the input signal are 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 displays a warning message when the assertion fails but allows the simulation to continue.
Specify a MATLAB® expression to evaluate when the assertion fails.
Enable or disable the assertion.
Use the blocks in the Model Verification library 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 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.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Check Dynamic Lower Bound | Check Dynamic Upper Bound | Check Static Lower Bound | Check Static Upper Bound