Ältere Kommentare anzeigen
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]
回答のほどよろしくお願いします。
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu 記述統計 finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!