I have a problem in I parallelize my matlab code,

Hello everyone
I use the parfor loop to parallelize my code here is the message that is displayed:"The temporary variable val in a parfor is uninitialized."

4 Comments

Please post the relevant part of the code, preferrably a minimal working example, and a copy of the complete error message.
parfor (i = 1:k,5)
members = (i == idx);
disp(strcat('Cluster numero <',num2str(i),'>'));
sousEns=Pts(members,:);
if(isempty(sousEns)==1)
continue
end
sousRay=Ray(members);
disp('De Centroid');
disp(C(i,:));
Echan=[];
for j = 1:size(sousEns,1)
xx=[];
yy=[];
zz=[];
xx=sousRay(j)*sin(phi).*cos(theta)+sousEns(j,1);
yy=sousRay(j)*sin(phi).*sin(theta)+sousEns(j,2);
zz=sousRay(j)*cos(phi)+sousEns(j,3);
% disp('OOOKKKKK')
n=size(xx(:),1);
Echan2=[];
Echan2(1:n,1)=xx(:);
Echan2(1:n,2)=yy(:);
Echan2(1:n,3)=zz(:);
Echan=[Echan2;Echan];
[xu,yu,zu] = sphere;
x = xu*sousRay(j) + sousEns(j,1);
y = yu*sousRay(j) + sousEns(j,2);
z = zu*sousRay(j) + sousEns(j,3);
c = ones(size(z))*1;
hold on;
surf(x,y,z,c);
end
end
here is the error: Use addAttachedFiles(pool, files) to specify the required files to be attached.
here is the error message:
An UndefinedFunction error was thrown on the workers for 'mex'. This might be because the file containing 'mex' 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.
excuse me as I often respond late. I do not yet understand how the forum looks

Sign in to comment.

Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!