" Error using readtable (line 198) An internal error occurred ". How can I solve this issue?

조회 수: 18 (최근 30일)
I am trying to load data stored in an Excel file (.xlsx) into MATLAB R2017a using readtable as in the following code:
data = readtable('Nuevo.xlsx');
However, when I run the command the following error message appears: " Error using readtable (line 198) An internal error occurred." I have tried to solve the issue providing the full path of the file but it also doesn't work. Can you please help me to find a solution?
  댓글 수: 5
Greg
Greg 2018년 5월 24일
My machine actually doesn't have Office installed and it still works.
DanRB
DanRB 2018년 5월 24일
In my case, yes Excel is installed and I am a Windows user. Should I suspect that that is the problem?

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

채택된 답변

Walter Roberson
Walter Roberson 2018년 5월 24일
readtable talks to excel on Windows with Excel installed, and on other systems uses internal routines. I am using Mac, which never talks to Excel; on my system, readtable() is happy with the file in R2016a,R2017a, R2018a (I did not try other versions.)
I suggest you experiment with
[num, txt, raw] = xlsread('Nuevo.xlsx');
I speculate that you will see an error message about an exception with a hex code that starts 0xC000 something. If so then that could suggest that you might have an Excel add-in such as FoxIt that is causing problems.
If you do see an error message with xlsread() then try
[num, txt, raw] = xlsread('Nuevo.xlsx', 1, '', 'basic');
That will force it to use the internal routines. When you do that then the dates you get back in the first column will be numeric and will be Excel date numbering system; you can convert to more readable form using datetime() with the option 'convertfrom', 'excel':
>> datetime(17533,'convertfrom','excel')
ans =
datetime
01-Jan-1948 00:00:00

추가 답변 (2개)

Jeremy Hughes
Jeremy Hughes 2018년 5월 24일
I tried,
T = readtable('Nuevo.xlsx')
T = readtable('Nuevo.xlsx','Basic',true)
And both worked for me. Sometimes the Excel install has issues and re-installing Excel or updated Excel may have an effect.
If Basic=true works, and Basic=false does not, that's an indication of a problem with Excel.
HTH, Jeremy

Mahboubeh Habibi
Mahboubeh Habibi 2019년 2월 23일
When you have a column name in your excel file that contains space or specific characters then you will get the error.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by