Long loading times using xlsread
Show older comments
Hello, I am trying to extract measurements from an .xlsx sheet into a matrix. Because of the format I extract everything as raw. I get long loading times (~40 minutes +) by using following code.
Is there any way to decrease the time needed to read the excel-sheet or increase the reading speed?
Help would be highly appreciated.
Dennis
pkg load io
daten_matrix = xlsread('FLL_Messdaten_100Hz.xlsx');
[~, ~, raw_head] = xlsread('FLL_Messdaten_100Hz.xlsx', 'A1:ZZ1');
spaltennamen = raw_head(1,:);
gesuchte_namen = {
"Loggerdata 100 Hz: Time",
"Az_ax1_WH_Right",
"Ay_ax1_WH_Right",
"Ax_ax1_WH_Right",
"An_ax1_WH_Right",
"Az_ax1_WH_Left",
"Ay_ax1_WH_Left",
"Ax_ax1_WH_Left",
"An_ax1_WH_Left",
"Az_ax2_WH_Right",
"Ay_ax2_WH_Right",
"Ax_ax2_WH_Right",
"An_ax2_WH_Right",
"Az_ax2_WH_Left",
"Ay_ax2_WH_Left",
"Ax_ax2_WH_Left",
"An_ax2_WH_Left"};
idx = zeros(1, length(gesuchte_namen));
for i = 1:length(gesuchte_namen)
idx(i) = find(strcmp(spaltennamen, gesuchte_namen{i}));
end
daten = daten_matrix(:, idx)
zeit = daten(:,1);
figure;
plot(zeit, daten(:,17));
xlabel('Zeit [s]');
ylabel('An_{ax2, WH, Left}');
title('An_{ax2, WH, Left} über Zeit');
grid on;
3 Comments
Cris LaPierre
on 29 Apr 2025
The first line is not valid MATLAB code. This appears to be Octave code, in which case, perhaps the Octave implementation is slow.
Out of curiousity, how does the code perform if you run it here (i.e. in MATLAB)? Use the paperclip icon to upload your spreadsheet, and then run your code by clicking the green play button.
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!