Main Content

Check Signal Range with Check Static Range Block

Using the Check Static Range block, you can check if an input signal falls outside of an unchanging range of values.

In this example, the Check Static Range block compares the value of a Sine Wave block to the values entered in theUpper boundandLower boundparameters, which are0.5and-0.5. The Constant blocks, labeled Upper Bound and Lower Bound, illustrate these parameters in the Scope block but do not affect the parameter values. The Check Static Range block checks if the value of the input signal is greater than theLower boundvalue or less than theUpper bound价值。If it is, the block assertstrue (1). Because theOutput assertion signalparameter of the block is selected, the block outputs the assertion value. Run the simulation to observe the model output.

At the start of the simulation, the Check Static Range block outputs1because the value of the Sine Wave block is less than theUpper bound价值。At a time of0.52, the sine wave exceeds0.5. The Check Static Range block recognizes this change and outputs0. When the time reaches2.62, the sine wave falls below theUpper boundvalue and the assertion istrue. When the time reaches3.67, the sine wave falls below theLower bound价值。检查静态块承认这个范围s change and outputs0. The output stays at0until the time is5.76, when the sine wave then exceeds theLower bound价值。This pattern repeats until the simulation end time.

See Also

|