Structural arrays on parfor loop
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Parallel for-Loops (parfor) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!