码迷,mamicode.com
首页 > 其他好文 > 详细

Matlab:fsolve No solution found.

时间:2019-12-24 11:57:06      阅读:94      评论:0      收藏:0      [点我收藏+]

标签:ons   because   near   col   class   命令行   vector   opp   div   

代码:

clear
M = 600;N = 420;p=200;q=2282;
eq = @(x) x^M-(1+q/p)*x^(M-N)+q/p;
options = optimset(MaxFunEvals,10000,MaxIter,1000);
x=fsolve(eq,1.2345,options);
r=1-x

问题描述:

No solution found.

fsolve stopped because the relative size of the current step is less than the
default value of the step size tolerance squared, but the vector of function values
is not near zero as measured by the default value of the function tolerance.

<stopping criteria details>

问题解决:

在命令行窗口键入x

得到 x 1.2114

修改原代码x初值为1.2114

运行,就Equation solved.

 

这个问题应该是迭代的原因,即越来越靠近正确答案。

Matlab:fsolve No solution found.

标签:ons   because   near   col   class   命令行   vector   opp   div   

原文地址:https://www.cnblogs.com/kmxojer/p/12090307.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!