a=10;
b=20;
f = figure('Position',[200 200 400 150]);
dat =a,b;
cnames = {'X-Data','Y-Data','Z-Data'};
rnames = {'First','Second','Third'};
t = uitable('Parent',f,'Data',dat,'ColumnName',cnames,...
'RowName',rnames,'Position',[20 20 360 100]);
how to enter a and b data into table?