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.

Edge Detector

Detect change in logical signal state


Control and Measurements/Logic


The Edge Detector block outputs a needle impulse when a change in the logical input is detected.

The Edge Detector block can be programmed to detect a rising edge (when the input goes from false to true), a falling edge (when the input goes from true to false), or either edge (any change in input is detected).


Edge detction

Select the detection criteria triggering the output impulse. Choices are Rising (default), Falling, or Either.

Initial condition of previous input

Specify the initial value of the previous input. The Edge Detector block can detect an edge at t = 0 if the input is different from the specified value. Default is 0.

Sample time (-1 for inherited)

Specify the sample time of the block, in seconds. Set to 0 to implement a continuous block. Default is 0.

Inputs and Outputs

The input signal must be a Boolean signal. The output is Boolean.


Direct FeedthroughYes
Sample TimeSpecified in the Sample Time parameter
Scalar ExpansionYes
Zero-Crossing DetectionYes


The power_Logic example shows the operation of the Edge Detector block.

The model sample time is parameterized with the variable Ts (default value Ts = 50e-3). To simulate a continuous Edge Detector block, specify Ts = 0 in the MATLAB® Command Window.

Introduced in R2013a

Was this topic helpful?