Return values in a parfor loop
Afficher commentaires plus anciens
Heyhey,
at the moment my source code looks like this
ParForQueue = parallel.pool.DataQueue;
afterEach(ParForQueue,@AddStruct);
parfor m = 1:Anzahl
...
send(ParForQueue, Satz)
end
...
function [] = AddStruct(Satz)
global TabellenRueckgabe
...
end
My question is: how is it possible to avoid the global variable. I want to use the function like this instead of using global
function [TabellenRueckgabe] = AddStruct(Satz, TabellenRueckgabe)
TabellenRueckgabe(x) = Satz;
...
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Background Processing 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!