Loop through a list of excel file names in a folder
조회 수: 17 (최근 30일)
이전 댓글 표시
I am trying to have MATLAB read a list of 30 rows in an excel sheet which correspond to actual file names that are located in a separate folder. The 30 rows of file names (filename1, filename2, filename3,...), are names of files given in another folder. I want MATLAB to read those file names from excel, attribute it to the corresponding file, and analyze it with the code I have written.
Originally, I have used the 'uigetfile' function to multi-select files. However, I want MATLAB to automatically retrive them, not have me individually select them.
Thanks in advance.
댓글 수: 1
Mario Malic
2021년 2월 22일
This will help you https://matlab.fandom.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
답변 (1개)
Bob Thompson
2021년 2월 22일
I recommend something like dir for automatic retrieval. Should be able to set it to find excel files only.
pathname = 'yourfilepathhere';
excelfiles = dir([pathname,'/*.xlsx']);
댓글 수: 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!