matlab第二次作业

f=inline('exp(x)-2*x^2');
fd=inline('exp(x)-4*x');
x0=0;
nmax=100;
toll=1e-10;
for n=1:nmax
x1=x0-f(x0)/fd(x0)
if abs(x1-x0)<=toll
break
end
x0=x1;
end
x1

猜你喜欢

转载自www.cnblogs.com/lsj1024/p/8974417.html