How to keep script running if surface fit function within failed?

2 views (last 30 days)
I wrote a script to automate my imaging analysis. It calls my custom surface fit function hundreds of times. Every once in a while the surface fit fails and I get the following massage:
Error using fit>iFit (line 353) Inf computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients.
I use Trust-Region algorithm and I have tight bounds for every parameter, theoretically I should not be getting this massage. Anyway, is it possible to keep the script going even if fitting function failed?
Thanks.

Answers (0)

Community Treasure Hunt

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

Start Hunting!