An UndefinedFunction error was thrown on the workers with parfor
10 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I got the error
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.
Caused by: Undefined function or variable "x"
when running the simple code below. Can anyone please help me with this?
Thanks,
clear all;
clc;
parfor n=1:1
for m=1:2
x{n}(m) = 1;
end
y = x{n}(1)
end
3 件のコメント
回答 (1 件)
Walter Roberson
2018 年 10 月 19 日
移動済み: Edric Ellis
2025 年 8 月 11 日
x = cell(1, 1);
before the parfor.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Parallel for-Loops (parfor) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
