Detect Threshold Crossings Using Event Count Comparator Block
ex_eventcountcomp_ref model. The Event-Count Comparator block (Event threshold = 3) detects two threshold crossings in the input to the Data port, one at sample 4 and one at sample 12.
All inputs and outputs are multiplexed into the workspace variable yout, whose contents are shown in the figure below. The two left columns in the illustration show the inputs to the Data and Int ports, the center column shows the state of the block's internal counter, and the right column shows the block's output.