Error using readtable: An error occurred while trying to determine whether "readData" is a function name
조회 수: 9 (최근 30일)
이전 댓글 표시
I get the following error when I am calling
readtable('file.csv')
Error using readtable (line 197)
An error occurred while trying to determine whether "readData" is a function name.
Note: readtable detected the following parameters:
'Delimiter', ',', 'HeaderLines', , 'Format', ''
Can you please help me on this one (do not provide me links on the same topic, I have checked everything and nothing is working) ?
댓글 수: 1
Mathieu NOE
2021년 10월 13일
hi
maybe you should share a copy of your csv file to let us check the issue
답변 (1개)
Prateekshya
2024년 7월 24일
Hi Sokratis,
The error you are encountering with "readtable" in MATLAB could be due to several reasons. You may consider the following steps:
- Ensure that the file path is correct and the file exists at the specified location.
filePath = 'file.csv';
if exist(filePath, 'file') ~= 2
error('File does not exist at the specified path.');
end
- Sometimes, MATLAB's path can get corrupted. Resetting it to the default state can help.
restoredefaultpath;
rehash toolboxcache;
- Try specifying the delimiter and other parameters explicitly in the "readtable" function.
opts = detectImportOptions('file.csv', 'Delimiter', ',');
T = readtable('file.csv', opts);
- Ensure that the file content is properly formatted and does not contain any unexpected characters or missing values that could cause issues.
- Clear any functions and variables that might be interfering with "readtable".
- If "readtable" continues to fail, try using "readmatrix" or "readcell" as alternatives to read the data.
I hope this helps!
Thank you.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!