Error using fminunc in parfor

3 次查看(过去 30 天)
Liane Canas
Liane Canas 2015-6-2
评论: Ahmed Nasr 2020-6-10
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 个评论
Peter Harrington
Peter Harrington 2015-9-14
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 2020-6-10
Is it solved now?
As I use Matlab 2020a and still have the same problem!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by