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]); Related SolutionsMATLAB: How to enter data into Table in GUI Suppose you had a matrix named DATA that you wanted to set the uitable() to contain. Then,set( Handle_of_uitable, 'data', num2cell(DATA) ) MATLAB: Insert table into figure You'll want to use uitable. Here's a very simple example:subplot(2,1,1);plot(1:10);uitable('Data', [1 2 3], 'ColumnName', {'A', 'B', 'C'}, 'Position', [20 20 500 150]); Related QuestionCreating uitable with multiple data typesAdd a title to uitableHow to extract column name of table in matlab
Best Answer