Can I avoid broadcast variable message within parfor loop
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Eva-Maria Weiss
am 31 Jul. 2019
Beantwortet: Walter Roberson
am 31 Jul. 2019
I want to use a parfor loop. My goal is to cut a tall column array in pieces to evaluate a smaller data amount. So far matlab underlines my variable dataBin with the message it's a broadcast variable
% dataBin = tall column array
% chunkLen = length of a chunk, to get a small part of the tall column array for evaluation using gather
parfor c = 1:numbCh
temp = dataBin((c-1)*chunkLen + 1 : c*chunkLen);
% ...some calculations returning vector..
dataCell(c,1) = vector;
end
Is there a way to avoid this message?
Thank you in advance
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 31 Jul. 2019
Reshape dataBin to chunkLen rows by whatever. Access one column indexed by the parfor variable
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Parallel for-Loops (parfor) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!