workingdir = 'n:\Projects\1207500\1207724\B. Measurements and calculations\Toestand_van_de_kust\Bayesian_modelling\4Kees\runs';

D = dir2(fullfile(workingdir, 'suppleties'), 'file_incl', '^run.*\.bot$', 'no_dirs', true);

%In principle only changes necessary for initial bed profiles ("BOT") and
%runs names ("runs")

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%INPUT%
Use_DM = 1;%0  no beach-dune module, 1  with beach-dune module
BOT = {D.name};%names initial bed profiles (folder "suppleties")
FIX = 'fixProf.bot';%names fixed layer position (folder "fix_layer")
D_BEQ = 115;%equilibirum beach width [m]    
D_FACON = 0.13;%factor dune erosion [1/year]
D_FACOFF = 0.12;%factor dune accretion [1/year]   
D_ND = 10;%obsolute input param          
%runs = [1:7];%names/numbering of runs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fid=fopen(['run1.bat'],'w');    

fprintf(fid,'%s %s %s %s %s %s %s %s %s \n',['rem'],['Run'],['Use_DM_KEY'],['D_BEQ_KEY'],['D_ND_KEY'],['D_FACON_KEY'],['D_FACOFF_KEY'],['BOT_KEY'],['FIX_KEY']);

for i=1:length(BOT)
    runname = BOT{i}(1:end-4);
    fprintf(fid,'%s %s %f %f %f %f %f %s %s \n',['call run2'],runname,Use_DM,D_BEQ,D_ND,D_FACON,D_FACOFF,BOT{i},FIX);
end

fclose(fid);