How to sum up a column in Matlab?

I have created a table as attached in Matlab. How do I create a new row which shows the total of Moles?

 Accepted Answer

iwant = sum(T.(4))

2 Comments

is it possible to add the answer in the table?
You see sum is going to be a single number and your table height (number of rows) is more, it looks wierd to add a single number to the table.

Sign in to comment.

More Answers (0)

Categories

Tags

Asked:

on 7 Apr 2021

Commented:

on 7 Apr 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!