MATLAB Answers

Angela
0

find local maxima around a point

Angela
さんによって質問されました 2019 年 4 月 26 日
最新アクティビティ Chris Turnes
さんによって 回答されました 2019 年 4 月 29 日
I have the following dataseries, shown below
example.jpg
I would like to find the edges of the peaks around X=7725 as marked.
I have managed to find the right peak (X=7738) using islocalmax and then taking the first index that is not zero.
However I have trouble find the X=7720 value, I can not use the same command. I thought of calculating the difference of X=7725 with all the points that are before it and then stop when the difference becomes positive but I was wondering if there is a more elegant way to do this.

  0 件のコメント

サインイン to comment.

タグ

1 件の回答

Chris Turnes
回答者: Chris Turnes
2019 年 4 月 29 日

If you can provide a MAT file with the data, it would be helpful in answering the question more concretely.
You should be able to do this with islocalmax. Once you've used whatever options you've used to identify your maximum point ('MinProminence', etc.), you can call islocalmax without any filtering options to get all the local maxima. This will be the set of all points that are strictly larger than their neighbors. The detected maxima immediately prior to your target maxima should be what you're looking for.

  0 件のコメント

サインイン to comment.



Translated by