How to reduce the time of reading an excel spreadsheet

조회 수: 1 (최근 30일)
Nalini Nadupalli
Nalini Nadupalli 2017년 11월 5일
편집: Nalini Nadupalli 2017년 11월 6일
I am trying to read an excel spreadsheet which has about 25 tabs. Each tab has string and numeric data. Ideally, data in each tab is stored in a separate matrix. I only need data from columns A:H of each tab and for unknown number of rows. If I do the following:
[~, tabs, ~] = xlsfinfo([handles.pathname, Filename]);
ntabs = length(tabs);
for i = 4:ntabs
Name = tabs{i};
tic
[~,~,raw] = xlsread([handles.pathname , Filename, Name];
toc
NF(i-3).Name = Name;
NF(i-3).Data = raw(7:end, 1:8);
end
each iteration (between tic toc) takes about 4.5 secs for each tab. A total of 25 tabs take 112sec
after changing the line
[~,~,raw] = xlsread([handles.pathname , Filename, Name];
to
[~,~,raw] = xlsread([handles.pathname , Filename, Name, 'A:H');
each iteration take now 6.4 secs. increasing the total time to 160 secs.
Any help on reducing the time taken for each iteration, is greatly appreciated. Thanks a lot in advance!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by