Working with time-series data in climate analysis

I have weather data .txt input files (about 700 files, 2 years) and each file presents a specific day info every minute. I should find the missing timesteps and corresponding data by interpolation. To be used in the desired software (EnergyPlus, TRNSYS), the data should avoid discontinuity and 1 minute timestep should be kept. To give you more clear overview you can find one week data sample in the attachment. I appreciate if you could help me.Thank you in advance.

1 Comment

What is the desired output format? The same as the input but re-sampled on to fixed timestep?

Sign in to comment.

 Accepted Answer

If you have access to R2016b, this is easy with a timetable:
>> tt = timetable(datetime(2016,12,19,12,[1;3;5],0),[10;20;25])
tt =
Time Var1
____________________ ____
19-Dec-2016 12:01:00 10
19-Dec-2016 12:03:00 20
19-Dec-2016 12:05:00 25
>> tt = retime(tt,'minutely','spline')
tt =
Time Var1
____________________ ______
19-Dec-2016 12:01:00 10
19-Dec-2016 12:02:00 15.625
19-Dec-2016 12:03:00 20
19-Dec-2016 12:04:00 23.125
19-Dec-2016 12:05:00 25
Prior to R2016b, you can use interp1 with a datetime vector as the grid points and query points.

1 Comment

Thank you Peter, fortunately I could have access to R2016b and I could solve it as you have demonstrated.

Sign in to comment.

More Answers (0)

Categories

Find more on Climate Science and Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!