Return values in a parfor loop
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Background Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!