findpeaksの利用方法
Show older comments
findpeaksで局所最大点を求め、最大値の1/2の値までを得たいときのプログラムができません。
y = [1 9 5 7 5 6 1 3 2 5 1];
x = 0:numel(y)-1;
plot(x,y)
[py,px] = findpeaks(y)
pyは局所最大点のyの値
pxは局所最大点のxの値
この例ですと
py = [ 9 7 6 3 5]
px = [ 2 4 6 8 10]
となります。
そして求めたい結果がmax9の半分(4.5)以上の値のyとx
py2 = [ 9 7 6 5]
px2 = [2 4 6 10]
回答のほどよろしくお願いします。
Accepted Answer
More Answers (0)
Categories
Find more on 記述統計 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!