Effacer les filtres
Effacer les filtres

problem with parfor loop

1 vue (au cours des 30 derniers jours)
freebil
freebil le 2 Oct 2013
Commenté : Matt J le 3 Oct 2013
Is it possible to parfor this?
for iter=1:50
for i=1:100
x(:,i)= rand(3,1)
end
end

Réponse acceptée

Matt J
Matt J le 2 Oct 2013
Modifié(e) : Matt J le 2 Oct 2013
Sure, especially since the outer loop is not doing anything and can be abandoned.
parfor i=1:100
x(:,i)= rand(3,1)
end
  6 commentaires
freebil
freebil le 3 Oct 2013
x(iter,i)= rand(1) with parfor??
Matt J
Matt J le 3 Oct 2013
Modifié(e) : Matt J le 3 Oct 2013
You can do it, but doing it without loops
x=rand(50,100);
will be faster.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Parallel for-Loops (parfor) 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!

Translated by