Why can I not import an excel file into MATLAB without error?

5 次查看(过去 30 天)
Hi,
I have an excel file with only two columns filled and 21 rows. Simply, one column is filled with x-values and the second column are y-values. Whenever I try to import that file (saved as .xlsx and I even tried saving it as .xls) into MATLAB, all I get is the error message "Could not open the spreadsheet. MATLAB reported the following error: Error: The server threw an exception."
I just want to import these values into MATLAB...it's such a small file. I could type the values in but the fact is I shouldn't have to.
  2 个评论
Rodney Sinkler
Rodney Sinkler 2017-3-19
I'm experiencing the same difficulty and the suggested post only addresses writing to xls. Just to be sure, I checked to see if I had any bluetooth add ins in excel and I don't. I even tried running MATLAB as an admin and the import wizard still reports "the server threw an exception" Please help!

请先登录,再进行评论。

回答(1 个)

Samuel Katongole
Samuel Katongole 2021-7-5
Try testing your files with the following trial codes:
fid=fopen('oil_prices_testdata.csv')
fid=fopen('oil_prices_testdata.xlsx')
I had a similar challenge; and checked the file identifier (fid). A positive one indicates your file will open, and if it is -1, then it will not open. If your obtain the latter, try putting your excel file in your current (or working) directory. And agin use the import tool.

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by