dir search multiple files
显示 更早的评论
Hello,
I am using the dir command to search a folder for specific file types. I am looking for both *.jpg and *.png files. How do I structure my statement so that I can search for both file types?
回答(1 个)
Fangjun Jiang
2011-9-19
7 个投票
Files=[dir('*.jpg');dir('*.png')]
3 个评论
Walter Roberson
2011-9-19
I think that might be the only option on MS Windows.
On OS-X or Linux there might be an additional more obscure method,
dir('*.{jpg,png}')
This should NOT be expected to work on MS Windows.
Michael
2014-9-10
I know this is an old link, but it totally saved me. Thanks!
Steve Grobler
2018-3-9
helped me too!!
类别
在 帮助中心 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!