Problem's variable used by workers
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I'm seeing documentation of parfor loop and i'm reading that i can't use global and persistent variables in parfor loop, so how i can share a "problem's variable" between workers? In my code there is a parfor loop that call some function, in this function that call other function (etc, etc) i need to read a "problem's variable", how i can do it without global and without pass variable between all function call? For exemple:
parfor i = 1:size(...)
var = function1()
end
function result = function1()
var2 = function2()
end
function result = function2()
global varsProblems;
%something else
end
3 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!