Why does readtable return invalid identifier only in 2020b
4 views (last 30 days)
Show older comments
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 Comment
dpb
on 21 Jun 2022
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)
...
Accepted Answer
Daniel Klisiewicz
on 22 Jun 2022
Edited: Daniel Klisiewicz
on 22 Jun 2022
1 Comment
dpb
on 23 Jun 2022
Edited: dpb
on 23 Jun 2022
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.
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!