Filter löschen
Filter löschen

Importing Excel multiple sheet with individual multiple columns

3 Ansichten (letzte 30 Tage)
Hi, first of all, thank you for reading this. I am trying to import a excel data (Attached file: Data_1.xlsl) with mutiple sheet and specific columns (ex: variable "LGRF_Fx" at each 3 trials). Below is the what I am trying to get the values.
I would appreciate sombody help me to find out.
-----------------------------
S01 = xlsread('Walking_Mastersheet_1.xlsx', 1);
T1 = S01(:, 10)/9.8;
T2 = S01(:, 19)/9.8;
T3 = S01(:, 37)/9.8;
S01=[T1,T2,T3];
S02 = xlsread('Walking_Mastersheet_1.xlsx', 2);
T1 = S02(:, 10)/9.8;
T2 = S02(:, 19)/9.8;
T3 = S02(:, 37)/9.8;
S02=[T1,T2,T3];
S03 = xlsread('Walking_Mastersheet_1.xlsx', 3);
T1 = S03(:, 10)/9.8;
T2 = S03(:, 19)/9.8;
T3 = S03(:, 37)/9.8;
S03=[T1,T2,T3];
.
.
.
DataTable = [S01,S02,S03....S15];

Akzeptierte Antwort

Bob Thompson
Bob Thompson am 25 Apr. 2019
What exactly is your question? What specifically do you need help with?
xlsread is only able to read one sheet at a time, so when reading multiple sheets it is necessary to call xlsread for each sheet.
Based on the context, I'm going to guess part of what you're asking for is a way to automate the process. Because you are looking for the same cells in each sheet that is relatively easy.
DataTable = [];
for i = 1:numsheets
tmp = xlsread('Walking_Mastersheet_1.xlsx',i);
DataTable = [DataTable,tmp(:,10)/9.8,tmp(:,19)/9.8,tmp(:,37)/9.8];
end

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by