- Example: 'Sheet', 2
- Example: 'Sheet', 'MySheetName'
- Example: 'Sheet', "MySheetName"
Importing data from an Excel file with multiple tabs
57 次查看(过去 30 天)
显示 更早的评论
I have an Excel file that I would like to pull data from, except it has multiple tabs and I have to use the command 'readtabe' to import the data because it is a mixture of different variable types. How can I specify which tab to pull data from?
0 个评论
采纳的回答
Cris LaPierre
2023-4-14
Use the 'Sheet' name-value pair to indicate which sheet to read the data from. Documented here: https://www.mathworks.com/help/matlab/ref/readtable.html#mw_0a3219fd-d40a-46a9-b230-7e249002f7b1
0 个评论
更多回答(1 个)
Walter Roberson
2023-4-14
filename = 'AsAppropriate.xlsx';
T1 = readtable(filename, 'Sheet', 3); %can give sheet index
T2 = readtable(filename, 'Sheet', 'partslist'); %can give sheet name
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!