Why does readtable return invalid identifier only in 2020b
4 次查看(过去 30 天)
显示 更早的评论
I have a comma delimited file in my home directory. I am able to import this file using 'readtable' in Matlab 2018b. I am unable to import data from this file using 'readtable' in Matlab 2020b. I receive the generic "Invalid file identifier" error.
I looked into the matlab internal functions, and I've found the root of why it can't see the file:
in +matlab/+io/+internal/+functions/ExecutableFunction line 61, it assigns the input of 'readtable' into the Filename field of the function object. Regardless of how I enter the argument ('/home/user/file','/home/user/file.csv',fullfile('/','home','user','file'), 'file') this line doubles up the path so that matlab thinks its looking for the file:
/home/user/home/user/file.
Is there a bug with 2020b? Or is there some setting/option somewhere that I might need to fix? The 2018b version of readtable seems to not use this internal io function package.
1 个评论
dpb
2022-6-21
I'm using R2020b and have seen no such symptoms with readtable and friends...which update are you running? If there were some bug and a patch, maybe need a given update, but I don't recall having seen such a symptom of any complaints here, either...
It would seem this would be a problem no matter where the file is located -- show us exact code entered and error in context and complete.
Here's output of ver for R2020b here that seems not to have any issues...on Win10, anyways; gather you may be on another OS, though.
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.9.0.1718557 (R2020b) Update 6
MATLAB License Number: xxxxxx
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19043)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.9 (R2020b)
...
采纳的回答
Daniel Klisiewicz
2022-6-22
编辑:Daniel Klisiewicz
2022-6-22
1 个评论
dpb
2022-6-23
编辑:dpb
2022-6-23
Indeed, that would be an unusual directory structure, but it isn't illegal.
I'd suggest this would be worthy of a bug report--would have to scratch head more to decipher what, precisely, the purpose was intended to be, but one guesses that is attempt to ensure not an empty path and the case you have wasn't considered as possible.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!