How to load multiple excel files with multiple excel sheets and store it in matlab faster?
조회 수: 2 (최근 30일)
이전 댓글 표시
I need to load around 50 excel files and each files has like 100+ sheets.
I need to store all this data in variables in my program.
This is the program i have written , I am using activex server and readtable but still it takes around 5 minutes for one excel file.
for i=1:numSheets
t1{1,i} = readtable(fullFileName, 'Sheet', i);
end
댓글 수: 0
답변 (2개)
Subhadeep Koley
2020년 2월 6일
If you have Parallel Computing Toolbox you can use parfor loop instead of normal for loop. That might decrease the time to read the files.
parfor i = 1:numSheets
t1{:, i} = readtable(fullFileName, 'Sheet', i);
end
Yair Altman
2020년 2월 9일
Try to use the 'basic' mode of xlsread, which reads the XLS file directly instead of using the much slower Excel instance:
for i=1:numSheets
[~,~,t1{1,i}] = xlsread(fullFileName, i, '', 'basic');
end
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!