How can I make use of Parallel Computing Toolbox to speed up my nested for loop?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi, Any advice on speeding up my nested for loop with Parallel Computing Toolbox or Distributed Computing Server? An extract of my code in the following: the calculatearea function call is called 5000*1500 times. Thanks!
i.e.
area = zeros(5000,1500);
for i = 1:5000
for j = 1:1500
area(i,j) = calculatearea(i,j,power,lat,long);
end
end
Answers (1)
Walter Roberson
on 13 Jan 2012
1 vote
The best way would probably be to vectorize your calculatearea routine.
1 Comment
Jan
on 13 Jan 2012
I agree. With parallel computing you have to start 1500 or 5000 or 7500000 jobs. It is worth to try to avoid the overhead required for this.
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!