FSOLVE No Solution Found yeilds valid answers
Mostrar comentarios más antiguos
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
Respuestas (2)
Matt Kindig
el 8 de Mzo. de 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
el 8 de Mzo. de 2012
0 votos
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!