In matlab uitables, Is it possible to add the data in each row together to get its summation? If so, how can i do it?
1 次查看(过去 30 天)
显示 更早的评论
I created the table using guide.
i have a 7x3 table and four each row i would like to add the data in the first 2 columns so that the summation will go in the third column.
I can i program this feature
any suggestions or examples relevant will help
thanks,
Cordelle
0 个评论
采纳的回答
Walter Roberson
2013-7-5
datacell = get(handles.YourTable, 'Data');
datamatrix = cell2mat(datacell(:,1:end-1));
sums = sum(datamatrix, 2);
sumscell = num2cell(sums);
datacell(:,end) = sumscell;
set(handles.YourTable, 'Data', datacell);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!