loop through subjects in Matlab path to run a program in subfolders
Show older comments
I am trying to loop through multiple subjects in multiple subfolders
This is what I want to do in the long run assuming I am working weith a single subject
"%direc = dir(['/Users/konan/Documents/Data/PO1/*.HWR']);"
path1 = '/Users/konan/Documents/Data/';
path2 = 'P01/'; (I want to loop through subject P1 - P90)
path3 = '*.HWR';
direc = dir([fullfile(path1,path2, path3)]);
3 Comments
Walter Roberson
on 11 Feb 2023
Do there exist P____ folders that are not P<digit><digit> ?
Is it important to loop folder by folder, or would it be okay to just go ahead and generate all of the file names in one shot (knowing that they could be classified by folder later if needed) ?
Reuben Addison
on 11 Feb 2023
Walter Roberson
on 11 Feb 2023
Is there, for example, a Pie_Recipes folder? A Photographs folder? Any other folder whose name begins with P but which is not P<digit><digit> ?
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!