fsolve function working at times but failing sometimes! Warning on non-square systems!

2 views (last 30 days)
Hello, Would somebody please explain to me why is that I sometimes get the following warning:
" Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead. "
I get an answer many other times without getting this warning, but 'sometimes' I get NaN as an answer along with this warning! This is while the code is exactly the same each time.
I am solving two non-linear equations in my program each time. This warning is related to fsolve function I use for solving those equations. Why is that this function sometimes fails but works the other times without any change in the code?!?
I would be grateful if somebody explain this to me as it makes my program very unreliable.
Thank you. Atekeh
  6 Comments
Matt J
Matt J on 13 Nov 2013
Without seeing your code, we cannot know. Maybe you have rand()-driven lines somewhere...
Atekeh
Atekeh on 13 Nov 2013
Oh the code is so long and nested that is not easy to look at. No, I don't have rand() function in my code. I appreciate your efforts to help though. Thanks.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!