Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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 Commenti
Rodney Sinkler
Rodney Sinkler il 19 Mar 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!

Accedi per commentare.

Risposte (1)

Samuel Katongole
Samuel Katongole il 5 Lug 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.

Categorie

Scopri di più su Data Import from MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by