CVX is a really efficient tool for me. Now, I want to use CVX in a parallel loop in matlab, for example
parfor ipeak = 1:t X_wh = A(:,:,ipeak); ZC = B(:,ipeak); beta = C; cvx_begin quiet variable Atemp(n) minimize( norm( ZC * Atemp - X_wh(:) , 2 ) + beta*norm(Atemp,1) ) subject to Atemp >= zeros(n,1) cvx_end end
However, matlab give the error code:
Attempt to add "cvx_problem" to a static workspace. See MATLAB Programming, Restrictions on Assigning to Variables for details. Error stack: cvx_begin.m at 41 tensor_BCGremove_sparsepar>(parfor body) at 102
Is it possible to use CVX in a parallel loop? If yes, please show me a demo; if no, do you have any alternative solutions ?
Thank you for your reading and help!