필터 지우기
필터 지우기

daily averages of hourly data

조회 수: 2 (최근 30일)
aggelos
aggelos 2012년 11월 4일
댓글: Felipe 2017년 4월 12일
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