用matlab解三角函数方程组:y=A+Bx+Csin(Dx)+Esin(Fx)

1个回答

  • x=[1 2 3 4 5 6 7 8 9 10 11];

    y=[110629.8 110891.7 806253.6 382533.3 97283.75 178900.8 438988.1 539365 65476.89 178967.3 344236.2];

    fun=inline('a(1)+a(2)*x+a(3)*sin(a(4)*x)+a(5)*sin(a(6)*x)','a','x');

    a=lsqcurvefit(fun,[1,1,1,1,1,1],x,y);

    A=a(1),B=a(2),C=a(3),D=a(4),E=a(5),F=a(6)

    A =

    3.423813841126758e+002

    B =

    9.505446184034091e+002

    C =

    -19.071272797384566

    D =

    3.619284092903295e+002

    E =

    -19.070562892582885

    F =

    3.619331675735504e+002