matlab怎么解x*sin(1/x)=0.5
2个回答

有两个根,可以用fzero求

ezplot('x*sin(1/x)-0.5',[-1 1])

hold on

x1=fzero(@(x)x*sin(1/x)-0.5,-1)

x2=fzero(@(x)x*sin(1/x)-0.5,1)

plot([x1 x2],0,'ro')

两个根分别是:

>> x1=fzero(@(x)x*sin(1/x)-0.5,-1)

x1 =

-0.5276

>> x2=fzero(@(x)x*sin(1/x)-0.5,1)

x2 =

0.5276

解当然是弧度制,验算也很简单:

>> x1*sin(1/x1)

ans =

0.5000

>> x2*sin(1/x2)

ans =

0.5000