我有一组周期性的(但不是正弦的)数据。我在一个向量中有一组时间值,在第二个向量中有一组幅度。我想快速估计函数的周期。有什么建议么?
具体来说,这是我当前的代码。我想根据向量 t 来近似向量 x(:,2) 的周期。最终,我想对许多初始条件执行此操作并计算每个条件的周期并绘制结果。
function xdot = f (x,t)
xdot(1) =x(2);
xdot(2) =-sin(x(1));
endfunction
x0=[1;1.75]; #eventually, I'd like to try lots of values for x0(2)
t = linspace (0, 50, 200);
x = lsode ("f", x0, t)
plot(x(:,1),x(:,2));
谢谢!
约翰