已知60=x*2*sin(pi*74/(4*x)),用matlab解此方程的语句该怎么写?

1个回答

  • solve('60=x*2*sin(pi*74/(4*x))')

    ans =

    -31.281066120310786755821961868485

    不过函数是偶函数,31.281066120310786755821961868485也因该是一个解,

    通过绘图也可以看出

    当然也可以用数值方法,但是对初值的依赖很大,你可以先绘图大致确定解的位置.

    在图可以看出解大约在30和-30左右所以有以下程序

    >> f=@(x)60-x*2*sin(pi*74/(4*x));

    >> fsolve(f,-30)

    Equation solved.

    fsolve completed because the vector of function values is near zero

    as measured by the default value of the function tolerance,and

    the problem appears regular as measured by the gradient.

    ans =

    -31.2811

    >> fsolve(f,30)

    Equation solved.

    fsolve completed because the vector of function values is near zero

    as measured by the default value of the function tolerance,and

    the problem appears regular as measured by the gradient.

    ans =

    31.2811