Filter löschen
Filter löschen

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

3 Ansichten (letzte 30 Tage)
Katherine Balasingham
Katherine Balasingham am 1 Jul. 2016
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 Kommentare
Rodney Sinkler
Rodney Sinkler am 19 Mär. 2017
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!

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Samuel Katongole
Samuel Katongole am 5 Jul. 2021
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.

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by