readtable truncates rownames if using ReadRowNames

10 Ansichten (letzte 30 Tage)
cmo
cmo am 14 Sep. 2015
Kommentiert: Ed Shen am 24 Mai 2023
One of the options for "readtable" is "ReadRowNames".
Apparently, when "ReadRowNames" is true, Matlab silently truncates the length of rownames to a maximum of 63 characters.
However, if you manually assigned row names to a table in Matlab, they can be of arbitrary length. (e.g. myTable.Properties.RowNames = cellArrayOfVeryLongStrings works and does not truncate row names.)
No warning is given, and this "feature" is not mentioned in any documentation or Matlab tutorial on Tables.
Note that Matlab issues various warnings when, say, Variable Names for table are too long, non-unique, contain invalid characters, etc. The crime here is that Matlab automatically "formats" incoming rownames in "readtable" without any warning or notification.

Akzeptierte Antwort

Peter Perkins
Peter Perkins am 15 Sep. 2015
cmo, you are correct, thank you for finding this bug. I will make a note to have it fixed. For the time being, you can read in the file with ReadRowNames set to false, and then assign the row names and delete the string variable.
Just out of curiosity, what names do you have that are more than 63 characters?
  5 Kommentare
Steven Lord
Steven Lord am 28 Mär. 2023
@Julan Prasad What release of MATLAB are you using? I suspect this is Bug Report 1295146 which is listed as affecting releases R2014a through R2015b and having been fixed in release R2016a. If you're using one of the affected releases, try upgrading to release R2016a or later.
Ed Shen
Ed Shen am 24 Mai 2023
I'm using 2021b and I'm still seeing this issue.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by