How to convert this for loop to parfor loop?

2 次查看(过去 30 天)
Hello All, I am very new to parallel computing, and I am having hard time converting all my for loops to parfor loops. However, If I understood how to convert this part, I think I will be able to convert many parts of my code. Any help will be appreciated.
I = size(A,1);
J = size(B,2);
parfor i = 1:I
for j = 1:J
C(i,6*j - 5) = U(6*B(i,j) - 5,1);
C(i,6*j - 4) = U(6*B(i,j) - 4,1);
C(i,6*j - 3) = U(6*B(i,j) - 3,1);
C(i,6*j - 2) = U(6*B(i,j) - 2,1);
C(i,6*j - 1) = U(6*B(i,j) - 1,1);
C(i,6*j - 0) = U(6*B(i,j) - 0,1);
end
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by