Reading file paths into cell array
19 次查看(过去 30 天)
显示 更早的评论
Hi all, Sorry for the how-to question (I don't normally ask these types of questions) but I'm a bit rushed on a job. I'll make it up by answering a few other questions. I need to read all the file names in the MATLAB path into an array, such that I can loop my program through each file without having to pass in file paths manually. Any ideas!? Thanks again, Paul
0 个评论
采纳的回答
Yao Li
2013-5-13
Try
list=dir()
all the file names under the specific folder will be listed and stored in the variable list
0 个评论
更多回答(2 个)
Azzi Abdelmalek
2013-5-13
files=ls('yourfolder')
1 个评论
Jan
2013-5-13
LS replies a slightly modificated output of DIR as a string. Parsing it afterwards to get a list of names wastes time compared with takeing the output of DIR directly.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!