Problem's variable used by workers
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!