Error using fminunc in parfor

9 views (last 30 days)
Liane Canas
Liane Canas on 2 Jun 2015
Commented: Ahmed Nasr on 10 Jun 2020
I used a parfor loop to try reduce the time of the loop. Inside this loop I have another loops, and inside one of these, I call a function to calculate a kernel. This kernel needs another function to minimise the value achieved. To minimise I used the fminunc function. For some loops everything ran well. However, after few iterations (I guess, after a few hundred) the loop is interrupted an e error appears: "Error using lineSearch (line 61): Search direction is not a descent direction; roundoff errors may be affecting convergence." I don't understand what is the problem because for the first loops all was fine. I hope someone with the same issue might be able to help me, or someone with any idea to solve the problem. Regards
  2 Comments
Peter Harrington
Peter Harrington on 14 Sep 2015
Old bug in MATLAB, many have complained and it still is not fixed in the latest version. Should just give a diagnostic and not exit the script with an error. Because it is caused by roundoff, you run the function a second time and it will execute fine.
Ahmed Nasr
Ahmed Nasr on 10 Jun 2020
Is it solved now?
As I use Matlab 2020a and still have the same problem!

Sign in to comment.

Answers (0)

Categories

Find more on Parallel Computing Fundamentals in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!