Parfor --> Undefined function 'colon' for input arguments of type 'distributed'.
이전 댓글 표시
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
댓글 수: 3
Raymond Norris
2021년 8월 13일
You might need to post what's being passed to my_function. And can you attach my_function as well?
Maria
2021년 8월 19일
Maria
2021년 8월 19일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!