Categorical Data
categorical values can appear as drop-down lists or as text. The categories appear in
drop-down lists when the ColumnEditable property of the Table UI component is
true. Otherwise, the categories display as text without a drop-down list.
f = uifigure;
cnames = categorical({'Blue';'Red'},{'Blue','Red'});
w = [400; 700];
tdata = table(cnames,w,'VariableNames',{'Color','Wavelength'});
uit = uitable(f,'Data',tdata,'ColumnEditable',true);
If the categorical array is not protected, users can add new categories in the running
app by typing in the cell.
Datetime Data
datetime values display according to the Format property of the corresponding table
variable (a datetime array).
f = uifigure;
dates = datetime([2016,01,17; 2017,01,20],'Format','MM/dd/uuuu');
m = [10; 9];
tdata = table(dates,m,'VariableNames',{'Date','Measurement'});
uit = uitable(f,'Data',tdata);
15 Component Choices and Customizations