How is parfor time taken is larger than that by normal for loop ?
1 view (last 30 days)
Show older comments
Nader Rihan on 17 Jul 2020
The time taken (t1) by parfor is larger than that (t2) by the normal for loop,I don't understand why ?
Sindar on 17 Jul 2020
Best guess: you don't preallocate y, nor clear it. So, the parfor needs to expand the vector constantly while the for is simply overwriting elements. Try
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!