1个回答
展开全部
x = 0:0.1:12
plot(x,besselj(1,pi*x),x,0) %画图形,观察根(零点)的位置
r(1) = fsolve(@(x)besselj(1,pi*x),1.2); %求根
r(2) = fsolve(@(x)besselj(1,pi*x),2.2);
r(3) = fsolve(@(x)besselj(1,pi*x),3.2);
r(4) = fsolve(@(x)besselj(1,pi*x),4.2);
r(5) = fsolve(@(x)besselj(1,pi*x),5.2);
r(6) = fsolve(@(x)besselj(1,pi*x),6.2);
r(7) = fsolve(@(x)besselj(1,pi*x),7.2);
r(8) = fsolve(@(x)besselj(1,pi*x),8.2);
r(9) = fsolve(@(x)besselj(1,pi*x),9.2);
r(10) = fsolve(@(x)besselj(1,pi*x),10.2);
结果为:
r =
1.2197 2.2331 3.2383 4.2411 5.2428 6.2439 7.2448 8.2454 9.2459 10.2463
plot(x,besselj(1,pi*x),x,0) %画图形,观察根(零点)的位置
r(1) = fsolve(@(x)besselj(1,pi*x),1.2); %求根
r(2) = fsolve(@(x)besselj(1,pi*x),2.2);
r(3) = fsolve(@(x)besselj(1,pi*x),3.2);
r(4) = fsolve(@(x)besselj(1,pi*x),4.2);
r(5) = fsolve(@(x)besselj(1,pi*x),5.2);
r(6) = fsolve(@(x)besselj(1,pi*x),6.2);
r(7) = fsolve(@(x)besselj(1,pi*x),7.2);
r(8) = fsolve(@(x)besselj(1,pi*x),8.2);
r(9) = fsolve(@(x)besselj(1,pi*x),9.2);
r(10) = fsolve(@(x)besselj(1,pi*x),10.2);
结果为:
r =
1.2197 2.2331 3.2383 4.2411 5.2428 6.2439 7.2448 8.2454 9.2459 10.2463
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询