Reading excel file sheets
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
NETHRAVATHI S
il 19 Mar 2021
Commentato: laurent jalabert
il 4 Feb 2022
How to read sheets of an excel file and save it. also I want to access these sheets inside a for loop for further analysis and plottig.
I have done like this.
filename = 'timeframe_wodsm.xls';
VHC = xlsread(filename,1);
HC = xlsread(filename,2);
MC = xlsread(filename,3);
LC = xlsread(filename,4);
Here I am getting 4 different files for each sheets,
For further analysis, logic is the same but i have to repeat it for 4 times. How to keep it in a loop?
Also how to plot 4 graphs for each of the sheets inside the loop itself?
1 Commento
laurent jalabert
il 4 Feb 2022
d = uigetdir(pwd, 'Select a folder');
DATA = dir(fullfile(d, '*.xlsx'));
[status,sheets] = xlsfinfo(DATA.name);
sheets = sheetnames(DATA.name);
for ii=1:length(sheets)
EachSheet{ii} = readtable(DATA.name,'Sheet',ii);
end
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!