How to reduce the time of reading an excel spreadsheet
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!