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
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!