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!