Knowing the presence of a peak around a point
1 回表示 (過去 30 日間)
古いコメントを表示
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
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
採用された回答
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
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!