how to use a uitable to add two numbers
Mostrar comentarios más antiguos
i have two input variable a and b.. my code is c=a+b. how to represent this in uitable
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 28 de Mzo. de 2014
figure('position',[100 100 400 150])
a=1;
b=2;
c=a+b;
data={a b c};
headers={'a','b','c=a+b'};
h = uitable('Data',data, 'ColumnEditable',true, ...
'ColumnName',headers, 'RowName',[], ...
'ColumnFormat',{'numeric','numeric','numeric'}, ...
'ColumnWidth','auto', ...
'Units','norm', 'Position',[0,0.25,0.65,.45]);
3 comentarios
Sivakumaran Chandrasekaran
el 28 de Mzo. de 2014
Sivakumaran Chandrasekaran
el 29 de Mzo. de 2014
Azzi Abdelmalek
el 29 de Mzo. de 2014
figure('position',[100 100 400 450])
a=[1 2;3 4;5 6;7 8]; % 4x2 array
data=[a sum(a,2)] % 4x3 array
headers={'a','b','c=a+b'};
h = uitable('Data',data,'ColumnName',headers,'Units','norm', 'Position',[0,0.25,0.65,.65]);
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!