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;
end