|
On Apr 30, 9:06 am, "Yvonne " <h...@waikato.ac.nz> wrote:
> Hi,
>
> I am trying to do some interpolation of timeseries data (24 hours) over different months but my timeseries are not continous.
> Here is an example of the timeseries:
> A= [2007 11 19 0
> 2007 11 19 23
> 2008 3 15 0];
>
> I have the data for November 2007 with hourly data, then I have data for March 2008 with hourly data. How do I interpolate between the hourly monthly data to make it hourly data between November 2007 to March 2008?
>
> Thank you
% Convert your times to Matlab days:
t=datenum(A(:,1),A(:,2),A(,3),A(:,4),0,0);
% Generate the new times at hourly intervals
tt=[t(1):1/24:t(end)]';
% Interpolate
yy=interp1(t,y,tt);
|