Running the Same code for Multiple Files in a Folder
4 次查看(过去 30 天)
显示 更早的评论
Is it possible to use the same code for Multiple Files in a Folder and save its output at particular location.
0 个评论
回答(1 个)
Chunru
2021-6-17
Here is a schetch of the solution:
fn = dir('a*.txt'); % obtain the file information 'a*.txt'. make your own modification
for i=1:length(fn) % loop through all the selected files in the folder
filename = fn(i).name;
% Perform any operation depending on the filename
% Save the results anaywhere you like
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Adding custom doc 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!