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 天)
显示 更早的评论
Kasih Ditaningtyas Sari Pratiwi
2017-12-4
评论: Kasih Ditaningtyas Sari Pratiwi
2017-12-5
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.
0 个评论
采纳的回答
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');
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Preprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!