How can I write a parfor loop with nested variable?
Afficher commentaires plus anciens
I want to write a parfor loop with nested variables. First folder name goes from 0 to 80 and each of them include another folder like 1, 2 ,3...11. but there is an error like this: "Assignment to x not supported. Variable has the same name as a local function." Is there any one can help me, please?
I have a code shown in below:
basedir=pwd;
filename='Analysis_GM.tcl';
exename='OpenSees.exe';
cmd=sprintf('"%s" < "%s"', exename, filename);
x=0:10:80
parfor i=1:length(x)
x(i)
end
function x(i)
parfor j=1:11
cd(fullfile(basedir, sprintf('%d',j)));
system(cmd);
end
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Parallel for-Loops (parfor) dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!