FSOLVE No Solution Found yeilds valid answers

I wrote a program that uses FSOLVE to find the solution to a set of 5 non linear equations. It is then put in a loop.
Problem is, if I run it in the command window with specific values it tells me it can't find a solution but then displays the correct answers. In my program it just displays the error over and over without allowing me to use the values that it's calculating.
Is there a way I can use the values and suppress the error and ignore that it isn't converging?
Thanks -Sam

Answers (2)

Does MATLAB throw an error or a warning? If it's a warning, you can turn the warning off using
warning(WARNID,'off')
where WARNID can be found using the lastwarn command:
[msg, WARNID] = lastwarn
If it's an error, you could use a try-catch statement with an empty catch part of the answer.
What is the error message, anyway? That might be useful to us.
Sam
Sam on 8 Mar 2012
I am given the message
% No solution found.
fsolve stopped because the problem appears regular as measured by the gradient, but the vector of function values is not near zero as measured by the default value of the function tolerance.
Does this mean the FSOLVE function completed successfully and just returned no solution?
The part that confuses me is that if I run the FSOLVE peice of my code by itself it yeilds the right answer (and this message). However, in my loop it won't let me access the results.
That and I am almost sure the system is solveable.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

Sam
on 8 Mar 2012

Community Treasure Hunt

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

Start Hunting!