Sum of specific row of all the coulumns
1 回表示 (過去 30 日間)
古いコメントを表示
Milosha Britto Nordbø
2020 年 5 月 16 日
コメント済み: Milosha Britto Nordbø
2020 年 5 月 16 日
I am trying to get the totals in row 7 for all the columns (marked in red).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/293491/image.png)
0 件のコメント
採用された回答
Ameer Hamza
2020 年 5 月 16 日
Run this example
t = {'row1', 100, 20, 35;
'row2', 200, 13, 34;
'row3', 450, 24, 24;
'row4', 20, 12, 10};
t = cell2table(t);
t{end+1,2:end} = sum(t{:,2:end})
0 件のコメント
その他の回答 (1 件)
Milosha Britto Nordbø
2020 年 5 月 16 日
2 件のコメント
Ameer Hamza
2020 年 5 月 16 日
Yes, that was just an example to create a table. If you already have a table, then there is no need.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!