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!