Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to sum groups of columns?

5 vues (au cours des 30 derniers jours)
Roos de Bruijn
Roos de Bruijn le 17 Mai 2017
Clôturé : John D'Errico le 17 Mai 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 commentaires
Stephen23
Stephen23 le 17 Mai 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 le 17 Mai 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.

Réponses (0)

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by