Edge operator shows both rising and falling edge

조회 수: 84 (최근 30일)
Max Sekundo
Max Sekundo 2021년 1월 26일
답변: Image Analyst 2021년 2월 1일
Im trying to detect the rising edge of a datastream. My code looks as follows:
data = importdata('myfile');
Trigger = data.data(:,1)
L = logical(Trigger)
which results in the following figure.
As I only want the rising edge the edge() operator from the image processing package should give me just that.
but for some reason it ends up like this:
M = edge(L);
what am i doing wrong?
thanks

답변 (2개)

Shubham Rawat
Shubham Rawat 2021년 2월 1일
Hi Max,
Edge functionality is used to detect edges(boundaries) in an image. You may look into the documentation here:
To detect rising or falling edge in data:
Hope this Helps!

Image Analyst
Image Analyst 2021년 2월 1일
Try this trick of using strfind():
risingEdgeIndexes = strfind(L, [0, 1]) + 1;

태그

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by