How to deal with multiple time series in MATLAB?
7 ビュー (過去 30 日間)
古いコメントを表示
I have some smart meter data which shows gas and electricity meter readings at 30 min intervals for about two years, for 16000 households. The date is stored in separate .mat files, with a datetime variable for the timestamp and a double variable for the actual data. Some of the data has gaps in, from a few hours to several days or weeks. I want to create a timeseries object containing all of the data and a continuous timestamp for the two year period, so that I can then interpolate the gaps. Another option would be to use snychronize, but for this it seems the 16000 data series need to be in individual timeseries objects, which seems cumbersome. I have tried this with timeseries objects and financial time series but cannot get all of the 16000 data series and corresponding timestamps into one time series object. When I try to add more than one series to an existing timeseries object, it is added "in series" rather than "in parallel" (i.e. data in the Data:1 column). When I tried with a financial time series I had difficulties preparing the datetime data in a cell array. Any ideas what the most efficient way to do this is? Thanks Russell
0 件のコメント
回答 (1 件)
Nikhil Vyas
2016 年 4 月 26 日
The approach I would use is: merge the MAT files, initialize the N x 16000 timeseries.
So basically after merging, your final MAT file would have the following data:
fin_MAT
Time Value1 Value2 ... Value16000
datetime1 val11 val21 ... val160001
datetime2 val22 val22 ... val160002
. . . ... .
. . . ... .
. . . ... .
datetimeX val1X val2X ... val16000X
From this, you can create a timseries using something like the following:
fin_ts = timeseries(fin_MAT(:, 2:end), <your_time_vector>, 'name', 'xyz');
2 件のコメント
Sriram Jayachandran Raguraman
2020 年 6 月 28 日
Hello Russell,
I'm having a similar problem for my project. could you tell me how to solve this problem ? How did you organise the data and passed it to the network ?
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!