problem with parfor loop

2 Ansichten (letzte 30 Tage)
freebil
freebil am 2 Okt. 2013
Kommentiert: Matt J am 3 Okt. 2013
Is it possible to parfor this?
for iter=1:50
for i=1:100
x(:,i)= rand(3,1)
end
end

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by