Find peak value in specific range.

13 ビュー (過去 30 日間)
Nur Ain
Nur Ain 2015 年 5 月 10 日
コメント済み: Nur Ain 2015 年 5 月 10 日
is anyone can help me to find a peak value for my data. i just want to detect the two highest peak from the graph for specific range of value in x-axis.. in order to make decision i need to classified the graph. i have used findpeak command as shown below, but there are a lot of peak that this function detect from my graph.
% To plot Graph
numFrames = AllData(1,:);
Width = AllData(2,:);
Height = AllData(3,:);
plot(numFrames,Height), title ('Height-Ab');
hold on
% Find peak
[pks,locs]=findpeaks(Height,'minpeakheight',160);
plot(locs,pks,'o','MarkerSize',3,'MarkerFaceColor',[1 0 0])
but i don't know how to make the command just valid for value nFrames in between 10 to 40 let say..

採用された回答

Walter Roberson
Walter Roberson 2015 年 5 月 10 日
indesiredrange = locs > 10 & locs < 40;
pks_subset = pks(indesiredrange);
locs_subset = locs(indesiredrange);
  1 件のコメント
Nur Ain
Nur Ain 2015 年 5 月 10 日
its works, thanks a lot..

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

その他の回答 (0 件)

カテゴリ

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