how to use a uitable to add two numbers
이전 댓글 표시
i have two input variable a and b.. my code is c=a+b. how to represent this in uitable
채택된 답변
추가 답변 (1개)
Azzi Abdelmalek
2014년 3월 28일
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
Sivakumaran Chandrasekaran
2014년 3월 28일
Sivakumaran Chandrasekaran
2014년 3월 29일
Azzi Abdelmalek
2014년 3월 29일
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]);
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!