필터 지우기
필터 지우기

hourly and daily averages

조회 수: 1 (최근 30일)
Devendra Pal
Devendra Pal 2019년 6월 13일
댓글: Akira Agata 2019년 6월 14일
%avergae values per hour
[ah,~,ch] = unique(data(:,1:4),'rows');
out_hour = [ah,accumarray(ch,data(:,5),[],@nanmean)];
%avergae values per day
[ad,~,cd] = unique(data(:,1:3),'rows');
out_day = [ad,accumarray(cd,data(:,5),[],@nanmean)];
%avergae values per month
[am,~,cm] = unique(data(:,1:2),'rows');
out_month = [am,accumarray(cm,data(:,5),[],@nanmean)];
%avergae values per year
[ay,~,cy] = unique(data(:,1:2),'rows');
out_year = [ay,accumarray(cy,data(:,5),[],@nanmean)];
I tried to used the same code to calculate the daily and hourly averages of my long term data which is yyyy,MM,DD,HH,MM,SS formate in different csv files. I ran initially code and stored all the data in different coloumn vector and then made the table and trying to avobe code but seems to be not working. Could you guide me how to i would get rid from my problem. It would be really appreciated.
Thanks!
Dev
  댓글 수: 1
Akira Agata
Akira Agata 2019년 6월 14일
I would recommend using retime function to calculate daily/hourly/monthly/yearly average.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by