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 ExchangeParallel 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