xlsread ERROR: Not enough input arguments

조회 수: 19 (최근 30일)
Christopher DeCarlo
Christopher DeCarlo 2015년 12월 16일
댓글: Scott MacKenzie 2021년 4월 27일
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
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
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
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
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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by