FSOLVE No Solution Found yeilds valid answers
Show older comments
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)
Matt Kindig
on 8 Mar 2012
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
on 8 Mar 2012
0 votes
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!