How to read all mat files from a folder in matlab?
207 次查看(过去 30 天)
显示 更早的评论
Hi, I have 1000 mat files in a folder. I want to use those mat files one by one. How do i read those files from a folder? Please help me.
2 个评论
Ashraf
2017-10-12
编辑:Walter Roberson
2017-10-12
mat = dir('*.mat'); for q = 1:length(mat) load(mat(q).name); end
Image Analyst
2017-10-12
You simply copied Uladzimir's 3 year old answer from below. Anyway, that is not as robust as the code in the FAQ, a link to which I gave in my answer.
回答(2 个)
Uladzimir
2014-7-2
Try this: mat = dir('*.mat'); for q = 1:length(mat) cont = load(mat(q).name); end I haven't checked it yet, but I have an experience in opening csv files this way. I don't remember, may be "load" isn't correct for mat files.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!