
Undocumented Secrets of MATLAB
®
-Java Programming158
The new uitable returns only a single argument — a MATLAB handle of the created table.
The new version of uitable is created in a similar manner to the old version:
mtable = uitable(gcf, 'Data',magic(3), 'ColumnName',{'A', 'B', 'C'});
set(mtable,'Position',[10,10,280,100]);
The new version of uitable
The new uitable’s data can be retrieved and set much more easily than the old version’s by
simply using the Data property (no cell casting is necessary):
>> data = get(mtable,'Data') % getting the data
data =
8 1 6
3 5 7
4 9 2
>> set(mtable,'Data',[1,2,3; 4,5,6]); % setting numeric data
>> set(mtable,'Data',{1,2,3; ...