%---------------------------------------------------------------
% user variables defined here 
%---------------------------------------------------------------
global SubInd SubIndStr MaskStr

%---------------------------------------------------------------
% batch variables defined here for analyses
%---------------------------------------------------------------

% analyses = struct( ... 
%    'type', 		[1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2], ...
%    'index', 	    [1 1 1 1 1 1 2 2 3 3 4 4 5 5 6 6], ...
%    'work_dir', 	[1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8], ...
%    'mfile', 	    [1 1 2 2 3 3 3 3 3 3 3 3 3 3 3 3]);

analyses = struct( ... 
   'type', 			[1 2], ...
   'index', 		[1 1], ...
   'work_dir', 	    [1 1], ...
   'mfile', 		[1 1]);
%-------------------------------------------

type = {'model','contrasts','defaults_edit','headers',...
	'means','realign','normalisation','smooth'};

%-------------------------------------------
WdP=['K:\fMRIData\fMRIDataGV\',SubIndStr];

Wd1=[MaskStr,'S',SubIndStr,'LoHi'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd1);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd1,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd1,' already exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd2=[MaskStr,'S',SubIndStr,'Para'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd2);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd2,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd2,' already exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd3=[MaskStr,'S',SubIndStr,'LoHi09'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd3);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd3,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd3,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd4=[MaskStr,'S',SubIndStr,'LoHi18'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd4);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd4,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd4,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd5=[MaskStr,'S',SubIndStr,'LoHi36'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd5);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd5,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd5,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd6=[MaskStr,'S',SubIndStr,'LoHi72'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd6);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd6,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd6,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end

Wd7=[MaskStr,'S',SubIndStr,'LoOff'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd7);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd7,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd7,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end

Wd8=[MaskStr,'S',SubIndStr,'HiOff'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd8);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd8,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd8,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end

Wd1=[WdP,FileSep,Wd1]
Wd2=[WdP,FileSep,Wd2]
Wd3=[WdP,FileSep,Wd3]
Wd4=[WdP,FileSep,Wd4]
Wd5=[WdP,FileSep,Wd5]
Wd6=[WdP,FileSep,Wd6]
Wd7=[WdP,FileSep,Wd7]
Wd8=[WdP,FileSep,Wd8]


work_dir = {Wd1,Wd2,Wd3,Wd4,Wd5,Wd6,Wd7,Wd8};

%-------------------------------------------
m1=['C:\Programme\Matlab12\toolbox\fmri\BatchModelLoHiOffSTC']
m2=['C:\Programme\Matlab12\toolbox\fmri\BatchModelParaSTC']
m3=['C:\Programme\Matlab12\toolbox\fmri\BatchModelLoHiSTC']
m4=['C:\Programme\Matlab12\toolbox\fmri\BatchModelTest']

mfile={m1,m2,m3,m4};

%-------------------------------------------

