how to find peaks
조회 수: 21 (최근 30일)
이전 댓글 표시
I want to find peaks from a plot, but I won't to use "findpeaks".
my professor told me to create a treshold in certain point and then count the peak as a region with "imfill".
I still didn't know ho to execute that, can someone give me some advice.
Here is an example code:
x=linspace(1,10);
y=sin(2*x);
plot(x,y)
댓글 수: 0
채택된 답변
Dyuman Joshi
2023년 11월 2일
I don't see how imfill would work with curves and plots (unless saved as an image, of course).
findpeaks finds the local maxima.
x=linspace(1,10);
y=sin(2*x);
idx = islocalmax(y);
plot(x,y)
hold on
plot(x(idx), y(idx), '*', 'MarkerSize', 10)
legend({'function', 'peaks'})
ylim([-1.2 1.2])
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!