Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by