How to reduce the time of reading an excel spreadsheet
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!