How to reduce the time of reading an excel spreadsheet

2 visualizaciones (últimos 30 días)
Nalini Nadupalli
Nalini Nadupalli el 5 de Nov. de 2017
Editada: Nalini Nadupalli el 6 de Nov. de 2017
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!

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by