Here is the simplified code:
The code is just a sample to describe my problem. Now I want to know if in the k_th loop, the program will report an error when the problem was not successfiully solved ,because the problem itself has no solution. Now I want to skip the errors and let the program continue and return a NaN value to get my emulated image. I used the ‘try’ function to try it but It’s not feasible.Please give me some advice ,thanks .