How to convert this for loop to parfor loop?

1 visualización (últimos 30 días)
Ahmad Gad
Ahmad Gad el 8 de Nov. de 2017
Editada: Ahmad Gad el 8 de Nov. de 2017
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

Respuestas (0)

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by