sum contents of array in groups of 10
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
My code produces a variable 'grains' which is a 1x3001 double.
I want to sum together the numbers in the first 10 cells, and repeat this in blocks of 10 cells until the end and save these in a new variable.
Please could somebody provide me with a starting point?
2 Kommentare
Stephen23
am 21 Jan. 2021
3001 is not exactly divisible by 10: what do you want done with the last element?
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!