54 lines
1.5 KiB
Matlab
54 lines
1.5 KiB
Matlab
%FrontEnd utility to copy source result sheet into Exp_ folders of
|
|
%StudiesQHTCP/StudyName/Exp1(2,3,4). This allow the automation of path
|
|
%capture to the StudiesDataArchieve.txt study log.
|
|
%Select, copy and Capture Study Exp_ details to study log
|
|
|
|
%Exp meta data collection
|
|
W=pwd;
|
|
%Load matlab stored data file into workspace
|
|
try
|
|
ExpLabel= strcat('Exp',W(end))
|
|
questdlg('\fontsize{20} Select the !!Results File','File Selection','OK', struct('Default','OK','Interpreter','tex'));
|
|
[resFile,resPath]= uigetfile('*.txt')
|
|
copyfile((fullfile(resPath,resFile)),fullfile(W))
|
|
resDate= char(regexp(resFile, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)','match'))
|
|
cd ..
|
|
Wstudy= pwd
|
|
studyDate= datetime("today");
|
|
S.sDate(1) = {studyDate};
|
|
if ispc
|
|
lastSep=max(strfind(Wstudy,'\'))
|
|
studyName= Wstudy((lastSep+1):end)
|
|
else
|
|
lastSep=max(strfind(Wstudy,'/'))
|
|
studyName= Wstudy((lastSep+1):end)
|
|
end
|
|
|
|
S.sDate(1)= {studyDate};
|
|
S.sName(1)= {studyName}
|
|
S.sPath(1)= {Wstudy}
|
|
S.ELabel(1)= {ExpLabel}
|
|
S.EresDate(1)= {resDate}
|
|
S.EresFile(1)= {resFile}
|
|
S.EresPath(1)= {resPath}
|
|
|
|
cd ..
|
|
|
|
fid = fopen('StudiesDataArchive.txt','a');
|
|
fprintf(fid,'StudyDate\tStudyName\tStudyPath\tExpNum\tExpDate\tExpPath\tResultFile\n');
|
|
fprintf(fid, '%s\t %s\t %s\t %s\t %s\t %s\t %s \n',S.sDate{1},S.sName{1},S.sPath{1},S.ELabel{1},S.EresDate{1},S.EresPath{1},S.EresFile{1});
|
|
fclose(fid);
|
|
%save((fullfile(pwd,'studyLog.mat')), 'S')
|
|
fclose('all');
|
|
|
|
catch
|
|
cd(W)
|
|
disp('Error: Unable to Execute ExpFrontend.m')
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|