xlsread ERROR: Not enough input arguments
19 次查看(过去 30 天)
显示 更早的评论
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 个评论
Mark
2021-4-27
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
2021-4-27
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.
回答(1 个)
Amir Hadi
2016-2-25
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 个评论
Image Analyst
2016-2-26
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!