problem with parfor loop

1 visualizzazione (ultimi 30 giorni)
freebil
freebil il 2 Ott 2013
Commentato: Matt J il 3 Ott 2013
Is it possible to parfor this?
for iter=1:50
for i=1:100
x(:,i)= rand(3,1)
end
end

Risposta accettata

Matt J
Matt J il 2 Ott 2013
Modificato: Matt J il 2 Ott 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 Commenti
freebil
freebil il 3 Ott 2013
x(iter,i)= rand(1) with parfor??
Matt J
Matt J il 3 Ott 2013
Modificato: Matt J il 3 Ott 2013
You can do it, but doing it without loops
x=rand(50,100);
will be faster.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Parallel for-Loops (parfor) in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by