Structural arrays on parfor loop

Hello,
I am using a parfor loop in the following nested structure:
parfor
for
for
end
end
end
I am also importing a few variables as structural arrays into my code and this must be reason why I'm receiving the following message:
%An UndefinedFunction error was thrown on the workers for 'x'. This might be because the file containing
%'x' is not accessible on the workers. Use addAttachedFiles(pool, files) to specify the required files to
%be attached. See the documentation for 'parallel.Pool/addAttachedFiles' for more details.
where x is a variable that receives a value of a cell out of a structural array.
STEP 1: To avoid this I replaced every structural array defined variable into a double outside the parfor loop. The error remained.
STEP 2: As suggested, used the command
addAttachedFiles({'file1.mat','file2.mat'})
to specify the structural array files inside the parfor loop even though I had already gotten rid of them before. The error remained.
Any suggestions?
Thanks in advance,
Kyriakos

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2017a

Gefragt:

am 11 Nov. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by