Errors using xlsread to import data from Excel

13 ビュー (過去 30 日間)
Justin Hayes
Justin Hayes 2020 年 4 月 1 日
コメント済み: Justin Hayes 2020 年 4 月 2 日
I am trying to pull data from Excel. I was able to do this up until today. I did update my Matlab license and am wondering if this has anything to do with the problems I am having below. Any suggestions?
Warning: Range cannot be used in 'basic' mode. The entire sheet will be loaded.
> In xlsread (line 208)
In untitled123123 (line 3)
Error using xlsread (line 257)
XLSREAD unable to read sheet 'irradiance_month'.
File contains unexpected record length. Try saving as Excel 98.
Error in untitled123123 (line 3)
Solar_Irradiance_Month = xlsread('DATA.xls','irradiance_month','C1:C13')
>>
  1 件のコメント
Justin Hayes
Justin Hayes 2020 年 4 月 1 日
This is the code I am running
Solar_Irradiance_Month = xlsread('DATA.xls','irradiance_month','C1:C13')

サインインしてコメントする。

採用された回答

Jeremy Hughes
Jeremy Hughes 2020 年 4 月 1 日
Sometimes the Excel instalation can break xlsread, there shouldn't be a reason MATLAB install changed anything for you. It might be an update, or just something out of sync.
I'd suggest you port this to readcell:
Solar_Irradiance_Month = readcell('DATA.xls','Sheet','irradiance_month','Range','C1:C13')
  3 件のコメント
Jeremy Hughes
Jeremy Hughes 2020 年 4 月 2 日
編集済み: Jeremy Hughes 2020 年 4 月 2 日
Actaully, if you know the data is all numeric, you can use readmatrix instead:
Solar_Irradiance_Month = readmatrix('DATA.xls','Sheet','irradiance_month','Range','C1:C13')
The indexing would then be the same as what you'd use with xlsread's results.
Justin Hayes
Justin Hayes 2020 年 4 月 2 日
thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by