Parallel code for "multi for" loops
2 次查看(过去 30 天)
显示 更早的评论
How make a multi for loop in parallel? See example below.
for i = 1:Nodex
for j=1:Nodey
nodpos_X((i-1)*Nodey+j,1) = (i-1) * delta + (delta / 2.0)*(-Nodex+1);
end
end
1 个评论
Walter Roberson
2015-6-25
That already seems to be nested for loops. I notice that your right hand side does not involve j, so you will end up with multiple copies of the same value.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!