Are temporary variables eliminated at the end of each parfor loop on every single worker?
2 views (last 30 days)
Edric Ellis on 8 Dec 2020
Yes, as mentioned in the documentation https://www.mathworks.com/help/parallel-computing/temporary-variable.html temporary variables are never sent back to the client. There are two ways to get results out of a parfor loop: either use sliced output variables, or reduction output variables. These variable types are explained here https://www.mathworks.com/help/parallel-computing/troubleshoot-variables-in-parfor-loops.html .