专题文章
时长:00:00更新时间:2024-12-01 01:50:06
f=@(x)exp(x)-3*x.^2;a1=fsolve(f,1);a2=fsolve(f,0);x=-2:0.01:2;y=f(x);figure plot(x,y,x,zeros(1,length(x))) hold on plot(a1,0,';r*';,a2,0,';r*';)。同样的方法可以应用于其他方程。例如,考虑方程f(x) = x*sin(x) - 1/2,可以通过以下代码找到其零点。
查看详情