I having two time series one is monthly and another one is in daily, now i need to average the daily time series to the particular time values of monthly time series

2 次查看(过去 30 天)
the sample time series is such that
for monthly: 2004.0438 1.975
2004.126 2.985
...............................
for daily : 2004.001360 .00567
2004.004100 .00458
................................
now i want to get the monthly average from daily time series whose time value should {whose time column should} match with the monthly time series, ie in monthly average of daily time series I need the time value as 2004.0438 2004.126 just as monthly time series
  16 个评论
David Young
David Young 2014-9-17
编辑:David Young 2014-9-17
I'm sorry, I can give you a solution, and so could dpb, but we need to know which solution you would like. I think maybe you don't understand my questions, but I've put them as clearly as I can. Last try:
  1. Do you want the averages to be over calendar months, or over fixed time periods centred on the monthly reading times?
  2. Does a fraction of a year mean the number of days divided by 365.25 always, or the number of days divided by 366 in leap years and 365 in other years?
dpb
dpb 2014-9-17
Does a fraction of a year mean the number of days divided by 365.25 always, or the number of days divided by 366 in leap years and 365 in other years?
Or the third alternative of 365 days always???
Or, perhaps the fourth -- "I don't know; pick one"

请先登录,再进行评论。

回答(1 个)

Yona
Yona 2014-9-17
find the value of middle of month by
m=1:12;
d=[1 0 1 0 1 0 1 1 0 1 0 1];
mid = datenum(0,m,15+d)/365
when m is the month and 16 or 15 depend if the month have 30 or 31 days.
To take the mean of data, find the value of month:
str = datenum(0,m,1)/365;
and then look on mdy. if it between str(1) -> str(2) it in january. ext.

类别

Help CenterFile Exchange 中查找有关 Time Series Events 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by