Matlab parallel toolbox

I used ‘parfor’ loop in a code in which I try to solve a optimization problem using CVX.

parfor I:1:10

solve a problem by cvx


The problem is that when I use ‘parfor’ , the cvx return NaN for some special input parameters while if I use ‘for’ loop it return a valid answer for the same input parameters. It is interesting that this problem occurs for those special input parameters and for other input parameters both of ‘parfor’ and ‘for’ return the same valid answer.
do you know what might be the problem? or can cvx work correctly when it is used in parfor loop?
thank you

CVX simply cannot be used with parfor. If it works sometimes, that’s an interesting artifact, but it should not be relied upon.