MATLAB: Uitable creates 2×16 table when data is specified as 1×16. Can this be fixed


I am attempting to create a 1×16 table for a gui using Guide. It appears there is a bug that prevents one from being able to make a table with less than four rows using the Table Property Editor solely, as any deleted rows are immediately readded upon hitting 'OK' or 'Apply.'
I circumvented this, though, by creating an empty 1X16 cell array and selecting it using the 'Data' property and the Table Property Editor's "Change data value to the selected workspace variable below" feature. The change is recognized by the Table Property Editor, as it displays a single row in the "Rows" tab once the data is changed. The change is not fixed by setting the 'Data' property to a 1×16 cell within the gui's opening function.
Despite this, when the GUI is run or the changes are applied in GUIDE, a 2×16 table is actually created (not including column headers). Is this a known issue? If so, is there a workaround? My MATLAB version is 2012a.

Best Answer

  • Well, this is embarrassing. I was working with some old code, and I found a line later on in the openingfunction that sets the data to a 2x16. Sorry for wasting time over what a control-F could have fixed. Previous bugs in the Table Property Editor had me so dead-set on it being a bug that I missed what was right in front of my nose. Question closed.