Error using .xlsread

조회 수: 8 (최근 30일)
Kareemulla Dudekula
Kareemulla Dudekula 2023년 11월 1일
답변: Yash 2024년 1월 2일
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
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.
Then, @KSSV's comment is extremely pertinent, don't use deprecated xlsread but one of the modern suggested replacements; readtable would be another likely candidate.
Kareemulla Dudekula
Kareemulla Dudekula 2023년 11월 4일
Thank you very much for the suggestions; I shall implement and see if the this persistan problem can be fixed.
Regards,

댓글을 달려면 로그인하십시오.

답변 (1개)

Yash
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.

카테고리

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