Reputation: 1
I have a data set in matlab with several variables (pressure, O2 levels, ect) that correspond to one time series.
I would like to add wind data to the dataset, but this time series has a different time scale. How can I interpolate this wind data onto my current time series? Any help is appreciated! Thanks!
Upvotes: 0
Views: 867
Reputation: 2385
You can interpolate your data by using interp1:
% // Original data
times = 0:6:20;
values = rand(1,length(times));
% Interpolated data
interp_times = 0:2:20;
interp_values = interp1(times,values,interp_times)
The vector interp_times defines for wich times a interpolation will be performed. The vector can be adjusted as needed.
The result would look like:
Upvotes: 3