Why will GUIDE not allow me to make a table smaller than 4 by 2?

조회 수: 1 (최근 30일)
I am trying to add a table component to my GUI in GUIDE. I would like the table to have three rows and three columns. When I use Table Property Editor dialog to try to delete the last row, pressing 'OK' or 'Apply' will cause the fourth row to reappear.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2012년 12월 17일
If you try to reduce the size of a UITABLE object in GUIDE to less than 4 rows or less than 1 column in either of the dimensions, GUIDE will not allow such a deletion, and the deleted dimensions will remain in the UITABLE object.
To work around this issue, follow the steps below:
First, right click on the table and click 'View Callbacks' -> 'CreateFcn'. In the table's CreateFcn code, add the following line:
% set the tables 'Data' property to a cell array of empty matrices.
% The size of the cell array determines the number of rows and columns in the table.
set(hObject, 'Data', cell(3));
If column and row headers are also being used, they must be set programmatically in the CreateFcn as well:
set(hObject, 'RowName', {'R1', 'R2', 'R3'}, 'ColumnName', {'C1', 'C2', 'C3'});

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by