Error using fminunc in parfor
3 次查看(过去 30 天)
显示 更早的评论
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
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!