Reputation: 2570
I have a Folder Factors
inside Project
folder. (all inside MyDocuments/Matlab). I need the list of all .m files in the folder FACTORS. Factors has subFolders and these subFolders hold all the .m files. Any suggestions?
Directory Design ->
Project...
Factors ... etc
subFol1 (has .m files)
subFol2 (has .m files)
...
Upvotes: 0
Views: 1626
Reputation: 36
I have solved a similar problem.On Windows platforms, ,Like this:
pathName='.... \FACTORS';%your path
[stat path]=dos(['dir ' pathName '\*.m /s /B >path.txt'] );
name=importdata('path.txt');
delete path.txt
Now,you can see all files which matches the conditions is in the cell array "Name"
Upvotes: 1