Finding max value in intervals

11 ビュー (過去 30 日間)
Marco Bosi
Marco Bosi 2019 年 8 月 9 日
コメント済み: the cyclist 2019 年 8 月 9 日
Good morning,
I'm postprocessing some field data and I need help in finding the max of a sinusoidal function in a defined interval.
Basically what I have to do is finding the maximun of a sinuoidal signal in a certain interval.
The code I'm using is the following:
t4=[0:1:t1-1];
findpeaks(Itot_up,t4,'MinPeakDistance',0.02)
But sadly it loks like it is not working. In the left picture (in red) is the point I would like to have, while the right one comes from the result. Does anyone know a way to help? Would also be helpfull if the all the data was saved somewhere, in order to have a plot with only the maxpeaks. Thanks. .
Best,
Marco

回答 (2 件)

the cyclist
the cyclist 2019 年 8 月 9 日
Given your nicely separated peaks, I think you could simply use the 'MinPeakDistance' name-value pair, as was done in this example from the documentation. See the findpeaks documentation for details.

Marco Bosi
Marco Bosi 2019 年 8 月 9 日
Thanks, I made it.
Now would it be possible to have a plot with only the maximum points (basically cleaning the graph and keep only the profile) and also having their values associated with an instant ? Thanks.
points.PNG
Marco
  1 件のコメント
the cyclist
the cyclist 2019 年 8 月 9 日
I'm not sure I fully understand what you mean, but I would think you could make the plot using some combination of the outputs
[pks,locs,w,p]
that come from the findpeaks() function

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by