Error using .xlsread
조회 수: 8 (최근 30일)
이전 댓글 표시
EDIT: adding picture here
Dear All,
I am reading data into my MATLAB code throguh several .xls files; occassionally, I am running into the error, 'Error using xlsread'. Could someone please help me understand the source of this error and help fix it.
Thanks in advnace!
Regards,
댓글 수: 5
dpb
2023년 11월 1일
Well, that's a painful way for respondents/volunteers here to have to try to search out what went wrong, @Kareemulla Dudekula. At a barest of minimums attach the text of the error (all the red text) in context with the code you ran that generated the error.
It's likely no real solution will be possible without the actual spreadsheet to test with; attach it instead of the one you did.
답변 (1개)
Yash
2024년 1월 2일
Hi Kareemulla,
I understand you are facing issues while using the "xlsread" function. As per the MATLAB documentation, "xlsread" is deprecated and is not recommended. You should use "readtable", "readmatrix", or "readcell" instead.
If, due to some reasons, you need to use "xlsread" function only, then consider the following points:
The error that you are facing is caused by excel, whis might be due to a variety of reasons. It is not possible to determine the exact reason without the actual spreadsheet. You can try these troubleshooting steps:
- Restart MATLAB: This works in most of the cases. The problem often resolves after a fresh restart.
- Check File Name Length: The character limit on the length of a filename in Excel (folder + base file name) is limited to 218 characters. ensure that it is shorter than that.
- Protected Mode in Excel: If the file is opened in the protected mode, make sure you enable editing and disable the protected mode.
- Network directory: If the file is present in a network(shared) folder, there might be a chance that many users are accessing the same file simultaneously. Try to copy that on your local disk and run again.
You can also seek help from the following MATLAB Answer:
I hope these suggestions help you address your query.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!