parfor - classification problem

I do not understand what the problem is in the following code:
% ...everything is defined in a way that a usual 'for' works fine
parfor l = 1:length(y)
for k = 1:length(z)
r = [0 2 3]; %position
for i = 1:length(R)
for j = 1:length(d)
r0 = [0 0 d(j)];
Myfield = B_field_loop(n,r,r0,R(i));
B_y(l,k)= B_y(l,k) + Myfield(2);
B_z(l,k)= B_z(l,k) + Myfield(3);
end
end
end
end
the error than I get is :
??? Error: The variable B_y in a parfor cannot be classified.
thanks in advance for every hint!

답변 (1개)

Florian
Florian 2012년 5월 9일

0 개 추천

the order is mixed up for this configuration. using
for l = 1:length(y)
parfor k = 1:length(z)
instead, does the job!

카테고리

도움말 센터File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

태그

질문:

2012년 5월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by