parfor sometimes throws out "Subscripted Assignment Dimension Mismatch"
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I've been using the following code to produce a table using parfor, and while it seems to work fine on my dual-core computer with two workers, using it on the HPC with 12 workers causes "Subscripted Assignment Dimension Mismatch" to occur. Does the difference in workers cause this error or is there another error in the code, and if so, how should I rectify this?
parfor t = startfile:endfile;
textFileName = ['results_' num2str(t-1) '.mat'];
x = load(textFileName);
modposition = x.modposition;
linvellen = x.linvellen;
angvellen = x.angvellen;
num = (numel(modposition))/3;
i = 1:num;
p = double(int16((modposition(i,1)-0.0015)/0.01));
[a,b] = hist(p,unique(p));
b = b+51;
b = b(b.*(b<400)~=0);
a = a(b.*(b<400)~=0);
A = zeros(400,1);
A(b) = a;
P(:,t) = A;
v = double(int16(linvellen(i,1)/0.01));
[a,b] = hist(v,unique(v));
b = b+1;
b = b(b.*(b<500)~=0);
a = a(b.*(b<500)~=0);
B = zeros(500,1);
B(b) = a;
V(:,t) = B;
r = double(int16(angvellen(i,1)));
[a,b] = hist(r,unique(r));
b = b+1;
b = b(b.*(b<500)~=0);
a = a(b.*(b<500)~=0);
C = zeros(500,1);
C(b) = a;
R(:,t) = C;
end
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!