show variables in parfor
Show older comments
Hi everyone,
I practice parfor code in help(matlab). i run code but dont know how to show variable in parfor.
parfor i = 1:4
temp = struct();
temp.myfield1 = rand();
temp.myfield2 = i;
end
parfor i = 1:4
temp = struct('myfield1',rand(),'myfield2',i);
end
Thank for helping me.
Accepted Answer
More Answers (1)
Tiki Tiki
on 18 Jul 2018
0 votes
2 Comments
Walter Roberson
on 18 Jul 2018
If you want to capture the console output of parfor(), then use diary(), or call the parfor() within evalc()
Tiki Tiki
on 18 Jul 2018
Categories
Find more on Parallel for-Loops (parfor) 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!