MATLAB: Table gui, set parameters

guimatlbatable

Hi, I have created simple gui with table. First how to set number of row and columns. If I want 2 col and 5 row?? And how to display in the first row 1 16 in the second 1 15 and in the thirth row 1 14 ?? I have written this but it doesnt work, any help? thanks
data1=[1 16;1 15;1 14]; % t=uitable(data,'Databaza') col_nazov={'A','B'}; Ncolumns=2; Nrows=4; set(handles.uitable1,'data',cell(Nrows,Ncolumns)) set(handles.uitable1,'data',data1,'ColumnName',col_nazov); guidata(hObject, handles);

Best Answer

Fairly simple,
data1=[1 16;1 15;1 14];
t=uitable;
t.Data = data1;
t.ColumnName = {'A','B'}; %and so on