How do I use save with a parfor loop using Parallel Computing Toolbox?
Afficher commentaires plus anciens
I would like to save some variables to .mat files from inside a parfor loop. However I get an error:
ERROR: ??? Error using ==> parallel_function at 598
Error in ==> parallel_function>make_general_channel/channel_general at 894
Transparency violation error.
See Parallel Computing Toolbox documentation about Transparency.
Réponse acceptée
Plus de réponses (1)
Daniel
le 14 Mar 2016
A nice alternative to implement your own save function is using the built-in matfile function:
parfor ii = 1:4
m=matfile(sprintf('output%d.mat', ii),'writable',true)
x = rand(10,10);
y = ones(1,3);
m.x=x;
m.y=y;
end
Here the parser has no issue understanding which variables are used.
Catégories
En savoir plus sur Parallel Computing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!