作业帮 > 综合 > 作业

matlab求一元函数零点

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/06/06 01:30:54
matlab求一元函数零点
f=4.268x^3-4.987x^2+1.786x+2.039-2.23978在区间[0.2,0.36]的零点
matlab求一元函数零点
f=@(x)4.268*x.^3-4.987*x.^2+1.786*x+2.039-2.23978;
>> x=fsolve(f,[0.2 0.36])
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance,and
the problem appears regular as measured by the gradient.

x =
0.2432 0.3192
>> feval(f,x)
ans =
1.0e-008 *
-0.9783 -0.0001