Loop Files from a Directory
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi, I want to loop files in a folder. I used the following method:
datadirs = dir('../Inputdata/URL2');
dircell = struct2cell(datadirs)' ;
filenames = dircell(:,1);
datafilename =strcat('../Inputdata/URL2/',filenames(3)); %just a try.
fid = fopen(datafilename);
It gives me an error message.
But when I used:
ff = '../Inputdata/URL2/2017032312_8952.txt'; %(The same as the "datafiename").
fid = fopen(ff);
It worked.
WHY!!!
How to fix the problem?
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
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!