From: Nicholas Jankowski <[hidden email]> Sent: Saturday, November 30, 2019 2:50 AM To: Henk Borsje <[hidden email]> Cc: Help GNU Octave <[hidden email]> Subject: Re: Taking a mean of a fixed length number of points
>I need to calculate the columnar average of each k points out of an array of
>x(n,m) elements, resulting in a new array x_avg (floor (n/k) , m) elements.
> tmp = reshape(x,k,,m); (1)
> x_avg = reshape(mean(tmp),,m); (2)
I think that what you use is the simpler and most efficient way. Rather
than resorting to 3-d arrays, I'd go columnar, by removing the fourth
argument in (1), which is cleaner to my eyes.
Francesco Potortì (ricercatore) Voice: +39.050.621.3058
ISTI - Area della ricerca CNR Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa Skype: wnlabisti
(gate 20, 1st floor, room C71) Web: http://fly.isti.cnr.it