means of a number of rows
Afficher commentaires plus anciens
I have a table with 86400 rows and 4 columns. For each column I would like to calculate a mean for every 1800 rows. Finally, I expect to have a table with 48 rows and 4 columns.
Something like that is working, but it is too big...
u_mean=[mean(u(1:1800,1)) mean(u(1:1800,2)) mean(u(1:1800,3)) mean(u(1:1800,4));mean(u(1801:3600,1)) mean(u(1801:3600,2)) mean(u(1801:3600,3)) mean(u(1801:3600,4));mean(u(3601:5400,1)) mean(u(3601:5400,2)) mean(u(3601:5400,3)) mean(u(3601:5400,4));mean(u(5401:7200,1)) mean(u(5401:7200,2)) mean(u(5401:7200,3)) mean(u(5401:7200,4));mean(u(7201:9000,1)) mean(u(7201:9000,2)) mean(u(7201:9000,3)) mean(u(7201:9000,4));mean(u(9001:10800,1)) mean(u(9001:10800,2)) mean(u(9001:10800,3)) mean(u(9001:10800,4));mean(u(10801:12600,1)) mean(u(10801:12600,2)) mean(u(10801:12600,3)) mean(u(10801:12600,4));mean(u(12601:14400,1)) mean(u(12601:14400,2)) mean(u(12601:14400,3)) mean(u(12601:14400,4))];
Could you advice for something else?
Furthermore, if I have additionally a table with time (86400,3), first column for hour, second column for minutes and third column for seconds, there is a way to have means for rows in certain times?
Thanks.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Neighborhood and Block Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!