uitable creates 2x16 table when data is specified as 1x16. Can this be fixed?

2 views (last 30 days)
I am attempting to create a 1x16 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 1x16 cell within the gui's opening function.
Despite this, when the GUI is run or the changes are applied in GUIDE, a 2x16 table is actually created (not including column headers). Is this a known issue? If so, is there a workaround? My MATLAB version is 2012a.

Accepted Answer

Evan
Evan on 23 Aug 2012
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.

More Answers (1)

Titus Edelhofer
Titus Edelhofer on 23 Aug 2012
Hi,
you could try to put into your GUIname_OpeningFcn the following line
set(handles.uitable1, 'data', cell(1, 16));
if uitable1 is the tag of your uitable ...
Titus
  1 Comment
Evan
Evan on 23 Aug 2012
Hi Titus, thanks for your answer. I attempted to do exactly this in the openingfcn and there was no change--sorry, I should have specified this in my post. I am able, however, to create a 1xn table using the uitable command, so I may do this--it's just a matter of how much change to my existing code is required as a result. :P
Edited my post to include the above info.

Sign in to comment.

Categories

Find more on Migrate GUIDE Apps 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!