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
4 ビュー (過去 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
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:
- Do you want the averages to be over calendar months, or over fixed time periods centred on the monthly reading times?
- 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
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
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 Center および File Exchange で Time Series Events についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!