title: Move files to a new folder for every model run
body: <p>After running the executable I want to store some newly created files for example, newfile_1.txt, newfile_2.txt to a new folder for every run (Run_1, Run_2...). I can only create one folder which overwrites the moved files after every run. Is there a solution to this?</p>
  
  <pre><code>% set working directory
  cd('E:\Tutorial\SimFolder\');
  runpath = 'E:\Tutorial\SimFolder\';
  
  %%
  myDir = 'E:\Tutorial\New_Files\'; %gets directory of files to be copied
  myFiles = dir(fullfile(myDir,'*.txt')); %gets all txt files in struct
  
  %%
  for k = 1:length(myFiles)
    baseFileName = myFiles(k).name;
    fullFileName = fullfile(myDir, baseFileName);
    copyfile(fullFileName,[runpath 'file.txt']); %copy &amp; rename file
    system('program.exe'); %run executable
    movefile([runpath 'newfile_1.txt'],'E:\Tutorial\Results\Run_1'); %this part needs to change
  end
  </code></pre>