I have a row of 1308 values and I need the total every 12 rows. So I need the sum of rows 1-12 and then again for the next 12 numbers
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Megan Mirkhanian
le 10 Fév 2020
Commenté : Megan Mirkhanian
le 10 Fév 2020
1
1
1
5
5
1
1
1
10
1
1
1
so basically I need the sum of all these numbers in this entire column for the 12 rows and then i need to get the values for the next 12 rows
0 commentaires
Réponse acceptée
chemPolonium
le 10 Fév 2020
Maybe you can use reshape and sum function.
For example:
a = rand(1, 1000); % this create a rand vector of 1000 dims
b = reshape(a, 10, 100); % this convert vector a to a matrix of 10 rows and 100 columns
c = sum(b); % this calculate the sum of each column
4 commentaires
Walter Roberson
le 10 Fév 2020
Modifié(e) : Walter Roberson
le 10 Fév 2020
What shows up for
size(Excel)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!