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

1 vue (au cours des 30 derniers jours)
Ali Al-Saegh
Ali Al-Saegh le 4 Sep 2020
Commenté : Ali Al-Saegh le 4 Sep 2020
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

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by