Speed up code on GPU by removing nested for loops
Show older comments
Hello! I'm trying to speed up the following element-by-element array operation using the parallel computing toolbox. Is this a good candidate for arrayfun? What might that look like? Any advice would be greatly appreciated.
for ii = 1:Nx
for jj = 1:Ny
f1(ii,jj) = exp(i*pi*(ii + jj));
end
end
Accepted Answer
More Answers (3)
Noah Walcutt
on 1 Oct 2018
0 votes
Noah Walcutt
on 11 Oct 2018
Edited: Noah Walcutt
on 11 Oct 2018
Noah Walcutt
on 11 Oct 2018
Categories
Find more on Parallel for-Loops (parfor) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!