Parfor --> Undefined function 'colon' for input arguments of type 'distributed'.
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I am new with the parallel toolbox and I need some help. I have a code that looks like this
function A = main_function(..)
parfor c1=1:m
for c2=1:n
if c2 >= c1
A(c1,c2,:)= my_function(..);
end
end
end
end
I get an error that says
Error using internal_compute_H_9int_vect_simplified (line 141). The source code (C:\Users\..\main_function.m) for the parfor-loop that is trying to execute on the worker could not be found.
Caused by:
Undefined function 'colon' for input arguments of type 'distributed'.
Error using remoteParallelFunction (line 84)
Worker unable to find file.
Undefined function 'colon' for input arguments of type 'distributed'.
At first I thought that the problem was the ":" in the matrix A, but then I tried this simple code
m = 3;
n = 3;
H = zeros(2,2,3);
beta =rand(3,1);
parfor c1=1:m
for c2=1:n
H(c1,c2,:) = 3*rand(3,1);
end
end
and it works.
What is the problem? Is related to the location of the function "main_function", to the matrix A , or to what I do in the funtion "my_function" ? What "distributed" actually means here?
Best
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!