link multiple data files
1 次查看(过去 30 天)
显示 更早的评论
Obviously new to MATLAB.. I have written a script & would like to run the script on multiple files without inputting a new file name each time. Thanks
0 个评论
回答(2 个)
Laura Proctor
2011-5-31
If all of the files live in the same directory, you can use the LS command. See below for a couple examples:
a = ls;
a = ls('C:\class\*.m');
b = cellstr(a);
Then, run through your script with each file name contained in the cell array.
另请参阅
类别
在 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!