Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

step

System object: dsp.Counter
Package: dsp

Increment or decrement the internal counter

Syntax

[CNT,HIT] = step(H,EVENT,RESET)
CNT = step(H,EVENT,RESET)
HIT = step(H,EVENT,RESET)
[...] = step(H)
[...] = step(H,EVENT)

Description

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

[CNT,HIT] = step(H,EVENT,RESET) increments, decrements, or resets the internal counter as specified by the values of the EVENT and RESET inputs. The output argument CNT denotes the present value of the counter. A trigger event at the EVENT input causes the counter to increment or decrement. A trigger event at the RESET input resets the counter to its initial state.

CNT = step(H,EVENT,RESET) returns the current value of the count when you set the CountOutputPort property to true, and the HitOutputPort property to false.

HIT = step(H,EVENT,RESET) returns a Boolean value indicating whether the count has reached any of the values specified by the HitValues property. This condition applies when you set the HitOutputPort property to true and the CountOutputPort property to false.

[...] = step(H) increments or decrements the free-running internal counter when you set the CountEventInputPort property to false and the ResetInputPort property to false.

[...] = step(H,EVENT) increments or decrements the internal counter when the EVENT input matches the event you specify for the CountEventCondition property and you set the ResetInputPort property to false.

    Note:   H specifies the System object on which to run this step method.

    The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.

Was this topic helpful?