MATLAB Answers

Are temporary variables eliminated at the end of each parfor loop on every single worker?

4 views (last 30 days)
shuai li
shuai li on 8 Dec 2020
Answered: Edric Ellis on 8 Dec 2020
I want to know, if the temporary variables inside the parfor loop are eliminated at the end of each loop, even on a single worker?

Accepted Answer

Edric Ellis
Edric Ellis on 8 Dec 2020
Yes, as mentioned in the documentation 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 .

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!