フィルターのクリア

How to calculate daily, monthly climatology from time series ?

15 ビュー (過去 30 日間)
Jeevan Kumar Bodaballa
Jeevan Kumar Bodaballa 2020 年 3 月 11 日
コメント済み: Ameer Hamza 2020 年 3 月 11 日
I have 10year series data with 1min resolution. I want to calculate daily, monthly climatology.
I mean I want to see each month variations over 10yrs.
Ex: Jan-2001+Jan-2002+.......+Jan-2010/10=result
like I want to do for all months and days

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 3 月 11 日
You can convert your data into timetable and transform it to a different scale using retime function
% generating a random table with daily values
times = datetime('2020-01-01'):days(1):datetime('2020-01-30');
Table = timetable(times', rand(length(times), 1), rand(length(times), 1));
Table_weekly = retime(Table, 'weekly', 'mean'); % calculating weekly average
  2 件のコメント
Jeevan Kumar Bodaballa
Jeevan Kumar Bodaballa 2020 年 3 月 11 日
Thank you for reply but this is not what I am exactly looking.
I want to pick whole January months from whole 10yrs and calculate mean. Like I want to do other months too.
Ameer Hamza
Ameer Hamza 2020 年 3 月 11 日
The same code will work with some modifications
% generating a random table with daily values
times = datetime('2011-01-01'):days(1):datetime('2019-12-30');
Table = timetable(times', rand(length(times), 1), rand(length(times), 1));
Table_monthly = retime(Table, 'monthly', 'mean'); % calculating weekly average
months_order = month(Table_monthly.Time);
all_month_sum = ...
cell2mat(splitapply(@(x) {sum(x, 1)}, Table_monthly.Variables, months_order));
all_month_sum(months_order(1:12), :) = all_month_sum; % bringing January to top
This creates random data for 9 years and then sum the values for all years. Final matrix has the of 12 x n, where n is the number of columns of the initial dataset.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWeather and Atmospheric Science についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by