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!