Matlab:fsolve No solution found.


代碼:

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.

 

這個問題應該是迭代的原因,即越來越靠近正確答案。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM