omitting pointers when listing folder contents
Ältere Kommentare anzeigen
In order to list folder contents I use:
TopFolder = dir('E:\');
Say if I had one file within that specific folder MATLAB returns 3 structures where the name of the first two are just pointers i.e. '.' and '..'.
How is it possible to omit these? I currently just omit the first two by:
a = SubFolder(3:end)
then use
a.name
to obtain the name. Is there a more accurate way of doing this i.e. supported by the documentation?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 12 Jun. 2012
TopFolder = dir('E:\');
TopFolder([TopFolder.isdir]) = [];
Kategorien
Mehr zu File Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!