필터 지우기
필터 지우기

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

조회 수: 27 (최근 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 CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by