GetSubjects.m 591 B

1234567891011121314151617181920212223
  1. function subjects=GetSubjects(pathdir)
  2. % Get the list of subjects as a cell array of strings.
  3. % Arguments:
  4. % - expPath: the experiment path
  5. files = dir(pathdir);
  6. nfiles = size(files);
  7. disp(size(nfiles));
  8. subjects = {};
  9. subjectsCounter = 0;
  10. % Take the first viable subject, then extract the conditions
  11. oldVersion = false;
  12. for i=1:nfiles[1];
  13. num = files(i).name;
  14. if files(i).isdir && ~isnan(str2double(num));
  15. subjectsCounter = subjectsCounter + 1;
  16. subjects{subjectsCounter} = num;
  17. end
  18. end
  19. end