Edge operator shows both rising and falling edge
82 ビュー (過去 30 日間)
古いコメントを表示
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/499913/image.png)
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);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/499918/image.png)
what am i doing wrong?
thanks
0 件のコメント
回答 (2 件)
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:
You may use this: Rising or falling edges of EdgeCount signals - MATLAB (mathworks.com)
Hope this Helps!
0 件のコメント
Image Analyst
2021 年 2 月 1 日
Try this trick of using strfind():
risingEdgeIndexes = strfind(L, [0, 1]) + 1;
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!