Issue with locating end of poorly defined peak

1 回表示 (過去 30 日間)
Teshan Rezel
Teshan Rezel 2022 年 6 月 19 日
コメント済み: Mathieu NOE 2022 年 6 月 22 日
Hi folks,
I have several graphs that look similar to the one attached. I am trying to formalise a general approach to finding the location of the start and end of each peak. The start is somewhat easy (using find, and the peak position can be found using max), since the graph starts from 0 (I am interested only in the second entry onwards).
However, the end is really tricky as it never quite gets to zero. I have tried using findpeaks, and also myEnd = find(iso(myPeakLoc:end, 1) > 1e-06); but to no avail.
Can someone advise me on an alternative route please?
  1 件のコメント
Mathieu NOE
Mathieu NOE 2022 年 6 月 20 日
hello
can you share your code as well (not only the data) ?
tx

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

採用された回答

Mathieu NOE
Mathieu NOE 2022 年 6 月 20 日
hello again
tried this - does it help ?
load('iso.mat')
curve = 10; % which curve do you want to plot ?
data = percent_iso(2:end,curve);
% max point
[maxval,maxind] = max(data);
% start point = find first point above 0.1% of max value
[startind] = find(data>0.001*maxval,1,'first');
startval = data(startind);
% stop point= find first point below 0.1% of max value past the peak
[endind] = find(data(maxind:end)<0.001*maxval,1,'first');
endind = endind + maxind;
endval = data(endind);
plot(data,'DisplayName','percent_iso')
hold on
plot(maxind,maxval,'dr',startind,startval,'dg',endind,endval,'dk');
hold off
legend('data','max','start','end');
  2 件のコメント
Teshan Rezel
Teshan Rezel 2022 年 6 月 21 日
@Mathieu NOE this is perfect, thank you!
Mathieu NOE
Mathieu NOE 2022 年 6 月 22 日
as always, my pleasure !

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by