match peaks from plot

v = hz1.Vdeg;
l = length(v);
t = 1:l(end);
plot(t,v);
[vmax,vindmax]=findpeaks(v,t);
[vmin,vindmin]=findpeaks(-v,t);
hold on
plot(vindmax,vmax,'o','MarkerFaceColor','r','MarkerSize',5);
plot(vindmin,-vmin,'d','MarkerFaceColor','g','MarkerSize',5);
figure
s = hz1.Dmm;
l = length(s);
t = 1:l(end);
plot(t,s);
[smax,sindmax]=findpeaks(s,t);
[smin,sindmin]=findpeaks(-s,t);
hold on
plot(sindmax,smax,'o','MarkerFaceColor','r','MarkerSize',5);
plot(sindmin,-smin,'d','MarkerFaceColor','g','MarkerSize',5);
I have these 2 peaks . how do I match the peaks from these two together ?

5 件のコメント

Image Analyst
Image Analyst 2022 年 6 月 12 日
編集済み: Image Analyst 2022 年 6 月 12 日
What exactly does "match" mean to you? And I see hundreds of peaks, not just two. I see two plots, each one having hundreds of peaks and hundreds of valleys. Please indicate the two peaks you want to "match" and mathematically define "match".
If you have any more questions, then ask them after you read this and clarify your question:
Jeffrey Clark
Jeffrey Clark 2022 年 6 月 12 日
@Jes, look at Find local maxima - MATLAB islocalmax (mathworks.com). If its not available in your version of MATLAB you can eliminate the relatively negative findpeaks you found and thenn do a findpeaks on the reduced findpeaks.
N/A
N/A 2022 年 6 月 13 日
@Image Analyst I need to match the peaks from 1st plot with the 2nd plot
N/A
N/A 2022 年 6 月 13 日
@Jeffrey Clark i couldnt get you clearly. Could you exlain a bit more? did you mean by using islocalmax I could reduce the amount of data?
Jeffrey Clark
Jeffrey Clark 2022 年 6 月 13 日
@Jes, yes. Look at the last figure on that documentation page, I suspect that method will work for you to give a reasonable number of peaks.

サインインしてコメントする。

回答 (0 件)

質問済み:

N/A
2022 年 6 月 12 日

コメント済み:

2022 年 6 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by