Long loading times using xlsread
显示 更早的评论
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 个评论
Cris LaPierre
2025-4-29
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!