Create table from excel spreadsheet with multiple sheets
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Suppose I have xlsx file with multiple sheets. I want to create table A from the first sheet and create table B from the second sheet. Please advise.
0 commentaires
Réponse acceptée
Image Analyst
le 7 Juil 2018
Try this:
folder = fileparts(which('patients.xls')) % Determine where demo folder is.
fullFileName = fullfile(folder, 'patients.xls');
[status, sheetNames] = xlsfinfo(fullFileName)
numSheets = length(sheetNames)
t1 = readtable(fullFileName, 'Sheet', 1)
t2 = readtable(fullFileName, 'Sheet', 2)
and so on. Put in a loop if you want.
2 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!