Time align data-sets and get the missing values with interpolation

5 次查看(过去 30 天)
Hello! Everyone,
I have two datasets which are logged at different rates. I am trying to time align these two data sets and after the data is time aligned i want to interpolate the and get the missing data values. I used a concept of timetables for time alignment but its taking forever to align that way. Can any one please suggest me how can i time align data and then fill up rest of missing data with the help of interpolation.
Thanks

采纳的回答

KSSV
KSSV 2018-5-22
You can do interpolation to get both the data sets to same time stamps. Read about interp1. After you get both the data's into same time, again you can use interp1 to get missing data. Or if you are using MATLAB 2016b or higher you can have a look on fillmissing to get the missing data.
  3 个评论
Matthew Hanks
Matthew Hanks 2018-8-20
When you use the synchronize function, try instead using this: newdata=synchronize(Anew,Bnew,'Uniform','Interval',0.001);
Peter Perkins
Peter Perkins 2018-8-24
Matthew, I think you're looking at the timeSERIES synchronize method. sc1991 is using the timeTABLE method (I think).
sc1991, take a look at the documentation for synchronize, in particular, the METHOD. I imagine you want something like 'linear' or 'spline'. The default is 'fillwithmissing', which is where all those NaNs are coming from.
I imagine you probably also want to align one timetable to the other, not align them both to the union of times. Take a look at the NewTimeBasis input.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Preprocessing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by