利用matlab求方程时如果限定未知数范围,比如x*sin(x)-1/2=0,求解方程在-10到10上的解?
>> x=solve('sin(x)*cos(x)-x*x=0')
x =
matrix([[0]])
这个方程只有两个解,为什么答案是这样?
人气:273 ℃ 时间:2020-02-05 09:28:39
解答
f=@(x)x.*sin(x)-1/2;x=fsolve(f,[-10:1:10])x =Columns 1 through 6-9.3714 -9.3714 -6.3619 -6.3619 -2.9726 -2.9726Columns 7 through 12-0.7408 0.7408 2.9726 2.9726 2.9726 6.3619Columns 13 through 156.3619...
推荐
猜你喜欢