parallel computing parfor implementation
2 次查看(过去 30 天)
显示 更早的评论
Hello,
Please see in attachment the sample for loop where a is 10*10 matrix with initial values.
How variable a can be controlled to implement parfor?
Thanks, Akand
0 个评论
回答(1 个)
Dasharath Gulvady
2015-5-11
I see in your code that each iteration is dependent on the values in the previous iteration.
var = a(i-1, j) + a(i+1,j);
This is not supported by parfor. You cannot use a parfor-loop when an iteration in your loop depends on the results of other iterations. Each iteration must be independent of all others.
0 个评论
另请参阅
类别
在 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!