"readtable" reads in the wrong data from an Excel spreadsheet.

12 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2020 年 7 月 21 日
回答済み: MathWorks Support Team 2020 年 12 月 8 日
When I read data from an XLSX file into MATLAB using "readtable", the wrong data is read in. I have checked the path to the file that I am reading, and it is correct, but the wrong data in still being read in.
However, if I save the XLSX as a CSV and use "readtable", the correct data is read in to MATLAB.
How do I get MATLAB to read in the proper data when I use "readtable"?

採用された回答

MathWorks Support Team
MathWorks Support Team 2020 年 7 月 21 日
This may be the result of a hidden sheet in the spreadsheet.
When you call "readtable", you can specify the sheet that you would like to read from as follows:
readtable(filename,'Sheet',sheetname)
This will ensure that you read in the correct sheet to prevent you from reading in the hidden sheet.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by