How to retime time series data every 15 minutes, or if it is not possible, to filter minutely data to 15-minutes data?

12 ビュー (過去 30 日間)
Hi! I have a question about how to retime time series data every 15 minutes. I have a time series data and I intend to retime it every 15 minutes. I use retime function, however it only provides retime in minutely for minute range. Is there any other way to retime time series data every 15 minutes?
Otherwise, I want to filter minutely data (from original data that I have retimed into minutely range) in every 15 minutes range. Is it possible to do that? I attach my original data, and here is the code I use for retime every minute:
%%Rainfall analysis
% for every minute
minutelyrainfall=table2timetable(rainanalysis);
minutelyrainfall=retime(minutelyrainfall,'minutely','linear');
minutelyrainfall=timetable2table(minutelyrainfall);
I would really appreciate for your help. Thank you very much in advance.

採用された回答

Akira Agata
Akira Agata 2017 年 12 月 5 日
To retime your data in every 15 minutes, first you should convert your data into 'timetable,' next create datetime vector (= resampling timing) and finally apply retime function. Here is an example.
load('rainanalysisdata.mat');
% Convert to timetable
rainanalysis.DatumUhrzeit = datetime(rainanalysis.DatumUhrzeit);
rainanalysis = table2timetable(rainanalysis);
% Create time vector (15 min duration)
t = rainanalysis.DatumUhrzeit(1);
startTime = datetime(t.Year,t.Month,t.Day,t.Hour,0,0);
time = (startTime:minutes(15):rainanalysis.DatumUhrzeit(end))';
% Resampling
rainanalysis2 = retime(rainanalysis,time,'linear');
  1 件のコメント
Kasih Ditaningtyas Sari Pratiwi
Kasih Ditaningtyas Sari Pratiwi 2017 年 12 月 5 日
Thank you so much, Akira Agata. I did not know that we can define start time and end time that way. Thanks, you're a life saver!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Preprocessing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by