Transparency violation error for cvx

3 次查看(过去 30 天)
I am having cvx inside the parfor loop and I am getting error below
Error using cvx_begin (line 41)
Transparency violation error.
See Workspace Transparency in MATLAB Statements.
My question is it is possible to use cvx code using parfor loop. if yes how can I avoid transparency error.

回答(1 个)

Raymond Norris
Raymond Norris 2021-10-6
It doesn't appear so. cvx_begin is calling assignin on line 41. This would be akin to calling
local = parcluster('local');
pool = local.parpool(1);
parfor idx = 1:1
assignin('caller','A',rand)
end
It's a transparency violation to try to have a worker assign back to the caller a variable (A in this case).

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by