Hi guys. I am using lsqnonlin for some fitting, and I am running a loop where I change the initial parameter values to determine the best ones based on the residuals; this is because the fitting is not as robust as I expected and it gives different results for different initial parameters (I would love to hear a suggestion for this as well…!). So, for some combinations of parameters it fails and gives this error:
Error using levenbergMarquardt (line 16)Objective function is returning undefined values at initial point. lsqnonlin cannot continue.
How can I make the process recognize the error, skip this run and proceed with finishing the loop?
Thanks
Best Answer