How to convert this for loop to parfor loop?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Random Number Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!