%% Type in Table Cell and Verify Change
% Create a table UI component that contains a mixture of different data types. Set the ColumnEditable property to true so that users can edit the data in the table.

fig = uifigure;
uit = uitable(fig);
d = {'Male',52,true;'Male',40,true;'Female',25,false};
uit.Data = d;
uit.ColumnName = {'Gender','Age','Authorized'};
uit.ColumnEditable = true;

% Create an interactive test case and verify the initial value of the table cell with indices (1,2).

tc = matlab.uitest.TestCase.forInteractiveUse;
tc.verifyEqual(uit.Data(1,2),{[52]})

% Change the value of the cell to 50 and verify the new value.

tc.type(uit,[1 2],'50')
tc.verifyEqual(uit.Data(1,2),{[50]})

% Copyright 2020 The MathWorks, Inc.