Reading many files in one loop
조회 수: 2 (최근 30일)
이전 댓글 표시
How can I read file names and convert them to a matrix? I have more than one file and I want to read their contents in one loop of the program. Thanks
댓글 수: 3
Jan
2013년 4월 4일
It is not useful to convert filenames to a matrix. Do you want to import the file's contents into a matrix?
채택된 답변
Ahmed A. Selman
2013년 4월 18일
Download a function file called folderFiles.m.
It'll do the job for you, hopefully.
댓글 수: 0
추가 답변 (2개)
ChristianW
2013년 4월 4일
doc dir
D = dir([myfolder 'my*file*name*.*']);
files = {D.name}';
댓글 수: 2
Jan
2013년 4월 18일
편집: Jan
2013년 4월 18일
This means, that no file matchs the filter:
'C:\Documents and Settings\John\My Documents\MATLAB\Pic_Down*.jpg'
Perhaps you want:
'C:\Documents and Settings\John\My Documents\MATLAB\Pic_Down\*.jpg'
Note: fullfile() is much better for constructing file names than STRCAT, HORZCAT or [.].
Jan
2013년 4월 4일
It is always a good idea to read the FAQ, because it is efficient to profit from the errors of others.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!