Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Error in classifying variable in parallel for loop.
2 ビュー (過去 30 日間)
古いコメントを表示
Hi! In the following code M1 is a 4d matrix. The error message I receive upon running this code is : The variable this_volume in a parfor cannot be classified. From what I understand I am just using the variable as a sliced input and output variable at the same time since I am assigning values to some of it's elements. I am not sure if the two extra for loops after the parfor are the cause of the problem. I will be grateful for any suggestions.
tic
fill_thresh = 12;
for a_fill = 1:size_M1(4)
this_volume = M1(:,:,:,a_fill);
this_volume_copy = this_volume;
parfor b_fill = 1:size_M1(3)
fill_factor = zeros(size_M1(1),size_M1(2));
for c_fill = 1+2:size_M1(1)-2
for d_fill = 1+2:size_M1(2)-2
fill_factor(c_fill,d_fill) = sum(sum(this_volume_copy(c_fill-2:c_fill+2,d_fill-2:d_fill+2,b_fill )));
if fill_factor(c_fill,d_fill ) > fill_thresh
this_volume(c_fill,d_fill,b_fill ) = 1;
end
end
end
toc
end
M1(:,:,:,a_fill) = this_volume;
toc
end
0 件のコメント
回答 (1 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!