xlsread ERROR: Not enough input arguments
20 views (last 30 days)
Show older comments
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 Comments
Mark
on 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
on 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.
Answers (1)
Amir Hadi
on 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 Comment
Image Analyst
on 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.
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!