how to continue program with fzero error
Mostrar comentarios más antiguos
Hi,
I am using fzero to solve a nonlinear univariate function. However, I am iterating over many parameter values. So, if fzero can't find a root for one set of parameters, that is fine, but I want it to continue to the next set. However, I keep getting the error
??? Error using ==> fzero at 293 The function values at the interval endpoints must differ in sign.
Can anyone tell me the proper way to handle this? Should I go into the function, comment out the error and put a default output, or is there a better way to do this. Thanks.
All the best, Bob
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 24 de Feb. de 2011
1 voto
Try-catch will certainly work, but I wonder why you don't just do the two endpoint evaluations yourself and skip the fzero call if the signs are the same?
2 comentarios
Jan
el 24 de Feb. de 2011
Voted. Avoiding an error is superior to catching it.
Bob Johnson
el 24 de Feb. de 2011
Categorías
Más información sobre Arduino Hardware 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!