Reading all the files in a folder for processing
이전 댓글 표시
I have to process 400 files within a folder and I know how to process each of them individually for the analysis part. But I don't want to choose them manually and do the processing. So I looked for matlab code and found some, but I could only find the structure of file not the data is loaded. Can someone please guide me on this? Here is my code so far.
projectdir = 'C:\Desktop\Research\EXPERIMENT\Spectra';
dinfo = dir(fullfile(projectdir));
dinfo([dinfo.isdir]) = []; %get rid of all directories including . and ..
nfiles = length(dinfo);
for j = 1 : nfiles
filename = fullfile(projectdir, dinfo(j).name);
f1 = fopen(filename, 'r');
...
fclose(f1);
end
댓글 수: 1
Rik
2020년 7월 21일
Apart from the missing formatting, the code looks fine. You edited away the part from which we could tell if you are overwriting the results, but otherwise I don't see any major issues.
What exactly is your issue?
채택된 답변
추가 답변 (2개)
MUHAMMAD Shoaib
2022년 6월 3일
0 개 추천
I want to convert my wave files to their spectrum (images). For this purpose I want to covert whole folder which contains 96 files and then save their spectrum images, any one help me plzzz
카테고리
도움말 센터 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!