EZmultiDay.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. %EZmultiday callled by EZmultidayGui
  2. global exp
  3. global exDlst
  4. global exFolder
  5. c=strfind(exDlst,' ');
  6. d=strfind(exDlst,'_');
  7. clear expDlstS
  8. ii=0;
  9. for n=1:(size(c,1))
  10. if ((sum(ismember(cell2mat(c(n)),[3,4]))==1 && ~isempty(ismember(cell2mat(c(n)),[3,4]))) ...
  11. || (sum(ismember(cell2mat(d(n)),[3,4]))==1 && ~isempty(ismember(cell2mat(d(n)),[3,4]))))
  12. ii=ii+1;
  13. expDlst(ii)=exDlst(n);
  14. end
  15. end
  16. clear matFile
  17. ii=0;
  18. for m=1:size(expDlst,2)
  19. exD=fullfile(exFolder,cell2mat(expDlst(m)))
  20. dirLst=dir(exD);
  21. clear matFlst
  22. clear resF
  23. clear resMatF
  24. for n=1:size(dirLst,1)
  25. if sum(ismember('Results2', dirLst(n).name))==8
  26. resF=dirLst(n).name
  27. resMatF=fullfile(exFolder,cell2mat(expDlst(m)),resF,'matResults')
  28. matFlst=dir(resMatF)
  29. for o=1:size(matFlst,1)
  30. if sum(ismember('.mat', matFlst(o).name))==4
  31. ii=ii+1;
  32. resDir{ii}=fullfile(exFolder,cell2mat(expDlst(m)),resF)
  33. matFile(m)=cellstr(fullfile(resMatF,matFlst(o).name))
  34. end
  35. end
  36. end
  37. end
  38. end
  39. Exp(expN).DexpLength=size(matFile,2);
  40. Exp(expN).DexpN=size(matFile,2);