gpt4 book ai didi

arrays - 如何使 findpeak 函数检测负峰而不是正峰

转载 作者:太空宇宙 更新时间:2023-11-03 19:34:46 25 4
gpt4 key购买 nike

我想知道如何让 findpeak 函数检测负峰而不是正峰,它检测下图中显示的红色峰,我需要检测蓝色峰..任何想法??

非常感谢。

enter image description here

最佳答案

如前所述,您必须使用-data

这是一个例子,

x = 0 : 1e-3 : 5*pi;
t = (0 : length(x)-1)*1e-3;
y = sin(x);
[p l] = findpeaks(y);
plot(t,y);hold on
plot(t(l),p,'ko','MarkerFaceColor','g');
[pn ln] = findpeaks(-y);
plot(t(ln),-pn,'ko','MarkerFaceColor','r');

给予,

enter image description here

关于arrays - 如何使 findpeak 函数检测负峰而不是正峰,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26836696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com