Block that outputs the total number of stages to be enabled.
The block compares the input u
with the threshold of each stage. If the input is greater
than a stage threshold, the output is set to that stage.
The block outputs the total number of stages to be enabled.
The parameter n
specifies the maximum number of stages.
The stage thresholds are evenly distributed, i.e. the thresholds
for stages [1, 2, 3, ... , n]
are
[0, 1/n, 2/n, ... , (n-1)/n]
, plus a hysteresis which is by default
h=0.02/n
.
Once the output changes, it cannot change for at least holdDuration
seconds.