作业帮 > 英语 > 作业

如何在matlab中求解tan(x)-x=-17.18741575,这个方程,急,

来源:学生作业帮 编辑:百度作业网作业帮 分类:英语作业 时间:2024/04/30 08:02:58
如何在matlab中求解tan(x)-x=-17.18741575,这个方程,急,
正确的答案好像是17.几
如何在matlab中求解tan(x)-x=-17.18741575,这个方程,急,
有无穷个解,可以采用图解法
如果求在某区域内的解,可以用fsolve
 fsolve(@(x)tan(x)-x+17.18741575,-5,5)
 Warning: Struct field assignment overwrites a value with class "double".
 See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. 
> In createOptionFeedback at 32
  In fsolve at 353
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.
<stopping criteria details>
ans =
   -7.8140

再问: 怎么利用数形结合来做呢
再答: 可以画图后,用 ginput取交点,要精确的话 放大后取点