xlsread ERROR: Not enough input arguments

19 Ansichten (letzte 30 Tage)
Christopher DeCarlo
Christopher DeCarlo am 16 Dez. 2015
Kommentiert: Scott MacKenzie am 27 Apr. 2021
Hi, I used the following line of code below to import an Excel file using xlsread.
nbaData = xlsread('nbasal.xls');
Initially it worked and the command imported the Excel file correctly. I stopped working and came back to my project a few hours later and started receiving the following error message:
>> nbaData = xlsread('nbasal.xls')
Error using xlsread (line 251)
Not enough input arguments.
I did not change the name of the file, the location of the file, or any data in the file. I have restarted Matlab multiple times and still receive the same error. Not real sure what is going on.
Any help or suggestions would be much appreciated. Thanks
  19 Kommentare
Mark
Mark am 27 Apr. 2021
I had this problem -- had downloaded an .xlsx file from lab file share and for whatever reason was getting the "not enough input arguments" error as above. I opened the file in Excel, re-saved it (again as .xlsx, overwriting the old file), and then xlsread was happy. (MacOS, 2020b)
Scott MacKenzie
Scott MacKenzie am 27 Apr. 2021
Seems you are excuting from the command prompt. The error is at line 251 which is within the code for the function.
Try putting this in a script and executing the script to see if the behaviour is different.
Finally, xlsread is no longer recommended. Try using readmatrix or readtable.
Just my two cents. Good luck.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Amir Hadi
Amir Hadi am 25 Feb. 2016
I also get this error...
the code is simple Data = xlsread('project.xlsx') but it gives me the following error:
Error using xlsread (line 251)
  1 Kommentar
Image Analyst
Image Analyst am 26 Feb. 2016
This is not an Answer that is useful to Christopher. Please post your question in your own new Question, and be sure and post all the red text, not just a small snippet of it like you did here. Also attach the workbook.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by