MATLAB: How to use a uitable to add two numbers

MATLABuitable

i have two input variable a and b.. my code is c=a+b. how to represent this in uitable

Best Answer

Sivakumaran, does this do the trick?
f = figure('Position',[200 200 350 150]);
a = 2; b = 4;
dat = [a b a+b];
cnames = {'a','b','c = a+b'};
t = uitable('Parent',f,'Data',dat,'ColumnName',cnames,...
'Position',[20 20 310 100]);