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!

Answers (1)

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

Categories

Tags

Asked:

on 9 May 2012

Community Treasure Hunt

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

Start Hunting!