Hi all,
I have a simple parfor test code like this:
inpt.a1 = rand(100);inpt.a2 = rand(100);parfor i = 1:10000 inpt_pass = inpt; otpt = sin(inpt_pass.a1);end
I wrote inpt_pass in order to pass the structure inpt into the parfor loop. However, if inpt is a very large structure, passing it into every parfor loop would be cumbersome, and cost loads of storage.
If I do:
inpt.a1 = rand(100);inpt.a2 = rand(100);parfor i = 1:10000 inpt_pass = inpt.a1; otpt = sin(inpt_pass.a1);end
which only pass part of the structure into parfor loop (ideal), I got the broadcast variable warning.
So how can I do it? Many thanks!
Best Answer