Edge Detection without function
이전 댓글 표시
How to make edge detection manually / without Matlab function?
댓글 수: 1
Walter Roberson
2018년 11월 12일
What operations are you permitted? For example in MATLAB, the == operator is a function.
답변 (1개)
Luna
2018년 11월 12일
Hello Fifit,
Signal should be a vertical vector. Value is a constant double. Index is the result which is a logical array where rising or falling edge occured.
Try this code:
signal = [10 10 5 5 2 2 2 5 5 8 8 5 5]'
value = 5;
This is for rising edge:
locations = (signal >= value);
diff_locations = [false ; diff(locations)];
index = (diff_locations ==1);
This is for falling edge:
locations = (signal <= value);
diff_locations = [false ; diff(locations)];
index = (diff_locations == 1);
댓글 수: 1
Holden Tranquillo
2023년 9월 20일
Great method, thanks
카테고리
도움말 센터 및 File Exchange에서 Object Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!