Knowing the presence of a peak around a point

조회 수: 1 (최근 30일)
Vinay Killamsetty
Vinay Killamsetty 2021년 5월 30일
댓글: Vinay Killamsetty 2021년 5월 31일
How to know wheather a peak is present around a ponint 'x0' in a 1d plot.
Clearly saying I want to know wheather a peak is present in the space 'x0-d' to 'x0+d' where d is a variable representing the distance from the point x0
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 5월 30일
Ah, but how do you define a "peak" for this purpose?
A
* *
* * C
* **B **X**
* *
Suppose C is within the defined range of X, but A is not within that range. C is a peak relative to BX, but C could also be said to only be on the shoulder of a different peak, A
Vinay Killamsetty
Vinay Killamsetty 2021년 5월 30일
Hi, Walter.
I want to chek whether the Maximum peak of the plot is in the defined range.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2021년 5월 30일
Assuming you have a vector of x values (rather than x0 being an index), and that your signal is called y:
acceptable_idx = find(abs(x-x0)<=d);
[~, peakidx] = max(y);
if ismember(peakidx, acceptable_idx)
%yes, peak is inside the desired interval
end
  댓글 수: 1
Vinay Killamsetty
Vinay Killamsetty 2021년 5월 31일
Thank you very much.
This has solved my problem

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by