chuanjunliu525 发表于 2011-3-2 14:00:05

matlab 解方程求助

需要用matlab 求解一个方程:1+cos(x).*cosh(x)=0.但是求出的结果是
ans =

[ empty sym ]
不知是什么原因。但书上已经有解,想x1=1.875,x2=4.964,x3=7.855.
各位同仁希望帮忙解答

lengyunfeng 发表于 2011-3-2 14:57:41

x2应该是4.694
>> clear
>> guess=1:8;
>> y=@(x)1+cos(x).*cosh(x);
>> fsolve(y,guess)
结果:
Optimization terminated: first-order optimality is less than options.TolFun.

ans =

    1.8751    1.8751    1.8751    4.6941    4.6941    4.6941    4.6941    7.8548
页: [1]
查看完整版本: matlab 解方程求助