How to apply function to certain files in directory
1 次查看(过去 30 天)
显示 更早的评论
I have a directory full of different files. The function I have will fopen and fread the content and process it to create other files. My function takes in parameter (parameter being the title of the file), but I would like to make the function run through the directory and read only the .raw files in that folder. Any help?
0 个评论
采纳的回答
Pawel Jastrzebski
2018-7-16
Just get the function to work on the selected files in the folder to begin with:
i.e.
fileNames = dir('*.raw'); % structure
fileNames = {fileNames.name}; % actual names extracted to cell array
1 个评论
Moulvi Faizan Ahmed
2019-12-11
But for the above method to be applicable the folder has to be in the current directory.
I need help on how to do the above requested task when the folder is not in the current directory and i dont want to change the directory.
另请参阅
类别
在 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!