fsolve returns non-integer exitflag
6 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am experiencing a strange problem. For as far as I know an exitflag should always be an integer (identifying the reason the algorithm terminated). However when solving my problem with fsolve, the exitflag turns out to be a non-integer: 1.329410886565489.
fsolve did not find a solution, but that is perfectly possible. The exitflag being a non-integer value on the other hand seems really strange to me.
What could be the problem?
Kind regards, Corrado Sirianni
5 个评论
采纳的回答
Alan Weiss
2014-3-7
I guess that you are interpreting the output of fsolve incorrectly. As stated in the function reference page, the outputs of fsolve are, in this order:
[x,fval,exitflag,output,jacobian] = fsolve(...)
exitflag is always the third output. I would bet that the third output that you obtain from solve is an integer, whatever name you give it.
Alan Weiss
MATLAB mathematical toolbox documentation
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!