I have tried to copy a file test.txt to multiple directories with one command:
for ii=0:5:175for jj=0:3:90newdir=sprintf('phi=%2dtheta=%2d',ii,jj);mkdir(fullfile(newdir))endendfor ii=0:5:175 for jj=0:3:90 source_dir=sprintf('G:/SYSTEM MATRIX - MCNP/phi%2dtheta%2d',ii,jj); copyfile('test.txt','source_dir') endend
But I didn't succeed. Is there a way to do that in one command so I can copy a file or even a folder to multiple directories?
Best Answer