readtable: no Constant property or Static method named 'init'

29 views (last 30 days)
Hi,
I am using matlab 2019b but I expereienced the exact same probelm on 2020b installed on a different machine.
I am trying to use readtable function
logEvent = readtable(filename, opts);
but I get an error message:
Error using matlab.io.ImportOptions/readtable (line 499)
The class table has no Constant property or Static method named 'init'.
the code used to be working fine previously when working with some other files.
I tried to re-install MATLAB but it did not help.
Even when I try to use "import Data" menu I get an error message saying that
The import toll doesn't have access to read the file.
an obviously I do have access (read and write) to a local folder on my computer.
Any idea what may be wrong?
BR
Afshin
  1 Comment
Menghuan
Menghuan on 24 Jan 2023
Hi, how did you deal with this error information then. Now I faced the same problem as you. A few days ago, it works perfectly well with the readtable function, but now it report errors:
Error using readtable.
The class table has no Constant property or Static method named 'init'.
I don't have any idea what is going on.

Sign in to comment.

Answers (1)

Sophia Snipes
Sophia Snipes on 12 May 2023
You likely have a script "table.m" somewhere, that took over the MATLAB native one. It may be a legacy version that is not compatible with later releases of MATLAB.
  1 Comment
Walter Roberson
Walter Roberson on 12 May 2023
It is more common for the problem to turn out to be that the user has third party software installed that has a function with the same name as one of MATLAB's functions. For example there is a third party toolbox that defines a function named "set" that causes problems and was always doomed to failure as "set" is a very old matlab function... the authors should have known better. There is a different toolbox that defines "height" which is a bit more justified for older software as height() only become a matlab function after table() objects were introduced.

Sign in to comment.

Categories

Find more on Tables 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!