daily averages of hourly data

2 次查看(过去 30 天)
how can I compute daily averages of hourly data in a column vector; the data have the following form and i have a total of 52584 observations.
1 4,36188440018071 2 4,24430502188277 3 4,21243736283539 4 4,21243736283539 5 4,16143877425792 6 4,16143877425792 7 4,13989429397492 8 4,13989429397492 9 4,30996473520857 10 4,30996473520857 11 4,45026849245099 12 4,32251521567370 13 4,32251521567370 14 4,32251521567370 15 4,28974153869163 16 4,32251521567370 17 4,51756258906766 18 4,74942794173664 19 4,74942794173664 20 4,57621696414906 21 4,51756258906766 22 4,35334832680403 23 4,32616576991108 24 4,30996473520857 1 4,20596290364125 2 4,13241078399449 3 4,13241078399449 4 4,06761746912333 5 4,06761746912333 6 4,06086643406207 7 4,20596290364125 8 4,19850762703210 9 4,25124417118600 10 4,36214866068717 11 4,45026849245099 12 4,37629784430253 13 4,33589281863478 14 4,32251521567370 15 4,32251521567370 16 4,32251521567370 17 4,50865928560725 18 4,60115716069051 19 4,60115716069051 20 4,46957360360858 21 4,41328512249549 22 4,37629784430253 23 4,32616576991108 24 4,30996473520857

采纳的回答

Andrei Bobrov
Andrei Bobrov 2012-11-4
编辑:Andrei Bobrov 2012-11-4
a = randi(3456,52584,1); % a your hourly data
out = mean(reshape(a,24,[]));
  4 个评论
Felipe
Felipe 2017-4-12
It is the maximum value of random numbers.
Felipe
Felipe 2017-4-12
You can specify min and max values in randi function.

请先登录,再进行评论。

更多回答(1 个)

Raju Purohit
Raju Purohit 2012-11-4
use a "for" loop. If your data values are stored in x, then
sum = 0;
for i=1:52584
sum = sum + x(i);
end
avg = sum/i;
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by