I have a Table that does fitting operations for 10000 datasets that looks as follows:
ParallelTable[
NonlinearModelFit[data[[i]], func[t,a,b,c,d], {a,b,c,d}, t],
{i,1,10000}];
Which I can change to a for loop if necessary for my problem. That's no problem.
I would like to be able to catch errors in this statement. So if NonlinearModelFit returns any kind of errors (saddle point, maximum iterations reached, non-convergence), I would like to have "i" printed or appended to some other array, in order to know which dataset is not compatible with the fit and debug it. How can I do that?
Just to paraphrase belisarius and make it an answer:
Use
Check[ mymaincommand, resultexpressioniferror, optionallistofspecificmessages]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With