Info

This question is closed. Reopen it to edit or answer.

How to sum groups of columns?

5 views (last 30 days)
Roos de Bruijn
Roos de Bruijn on 17 May 2017
Closed: John D'Errico on 17 May 2017
Hi there.
I am kind of a noob in matlab but need it for my thesis. I was wondering whether there was any way to sum different groups of columns with each other. I am working with a very large database and want to sum every 4 columns from the 3724th column on. So 3725-3728, 3729-3732, etc. Is there any command to do this?
  3 Comments
Stephen23
Stephen23 on 17 May 2017
@Roos de Bruijn: to achieve what you want you will probably need to use multiple commands. Most likely reshape and sum will do what you want.
John D'Errico
John D'Errico on 17 May 2017
So it is time to learn MATLAB then. Should your thesis be something that you did not do, only got others to do your work for you? Or, perhaps you will give credit on the front page, listing those who did your work?
I'll give you a hint: if you reshape your array, then can you use sum? You will also need to extract those columns. So you need to learn about indexing.
But if we just give you the answer to your question, with no effort made by you, then you learn nothing, except get your thesis done, partly by someone else.
So make an effort. You might learn something.

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!