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

2 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by