I have a folder named "fp" wherein lies folders for each subject. Within each subjects folder lies further set of folders for subjects data named 000001, 000002 etc.
I can store the directory for the "fp" folder in a variable. And then I would like to create another variable with another directory for each subject.
It is as if I want to create a variable subjects = "sub*" that means that all subjects folders begin with "sub"....
And then further on, define another directory in the same way for the data folder = subjects/'0000000*' meaning that all data folders within each participants folder begin with 7 zeros (or whatever). How can this be done?
I do not want to check if they exist or create if necessary. I want to go through each subject and each subjects datafolders to finally obtain information from the first file in the datafolder
in MATLAB this could be done like follows, I think:
subjectPattern = 'sub*'; % name pattern
rootDir = '...../fp';
dirs = dir(fullfile(rootDir, subjectPattern));