Sum of specific row of all the coulumns
1 view (last 30 days)
Show older comments
Milosha Britto Nordbø
on 16 May 2020
Commented: Milosha Britto Nordbø
on 16 May 2020
I am trying to get the totals in row 7 for all the columns (marked in red).
0 Comments
Accepted Answer
Ameer Hamza
on 16 May 2020
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 Comments
More Answers (1)
Milosha Britto Nordbø
on 16 May 2020
2 Comments
Ameer Hamza
on 16 May 2020
Yes, that was just an example to create a table. If you already have a table, then there is no need.
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!