The PARFOR loop cannot run due to the way variable 'm' is used

2 Ansichten (letzte 30 Tage)
Matlab shows "The PARFOR loop cannot run due to the way varialbe 'm' is used".
Please, how to parallelize both of the loops.
m=1;
for iClss = 1:nuClasses
for iTry = 1:nuTrials
fCreateFiless(cTrials{iTry,iClss}', iClss, parentFolder, m, samFreq);
m=m+1;
end
end

Akzeptierte Antwort

Matt J
Matt J am 4 Sep. 2020
Bearbeitet: Matt J am 4 Sep. 2020
parfor m=1:nuClasses*nuTrials
[iTry,iClss]=ind2sub(size(cTrials),m);
fCreateFiless(cTrials{iTry,iClss}', iClss, parentFolder, m, samFreq);
end

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by